Skip to content

[css-conditional-3] Setting .conditionText interop is terrible #6819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fantasai opened this issue Nov 16, 2021 · 5 comments
Closed

[css-conditional-3] Setting .conditionText interop is terrible #6819

fantasai opened this issue Nov 16, 2021 · 5 comments

Comments

@fantasai
Copy link
Collaborator

fantasai commented Nov 16, 2021

The CSS Conditional Rules spec specifies that conditionText can be set, and if it is grammatical, updates the condition applied to the CSSConditionRule to which it applies.

So far, Firefox mostly supports this correctly on CSSMediaRules, and mostly fails on CSSSupportsRule; and neither Blink nor WebKit seem to support setting conditionText at all. See testcase Do we want to file bugs, or redefine conditionText as readonly?

@Loirooriol
Copy link
Contributor

Loirooriol commented Nov 20, 2021

I think this should be consistent with CSSStyleRule's selectorText. I remember getting frustrated at some point because that was readonly on Firefox, but later it got fixed.

@tabatkins
Copy link
Member

Being able to update the condition for a rule is somewhat useful for tools today, as you can use it to toggle entire blocks of rules easily by just setting the condition to something that's always-true or always-false. Ultimately we want to solve this use-case better with custom MQs, but given that setting the conditionText does work in at least some places today, I think it's reasonable to preserve that if possible.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed conditionText setter interop, and agreed to the following:

  • RESOLVED: Make conditionText readonly
The full IRC log of that discussion <emilio> topic: conditionText setter interop
<emilio> github: https://github.com//issues/6819
<emilio> fantasai: there's a lot of failures when I was testing this. Firefox was the most correct on @media but fails on @supports. WebKit / Blink doesn't support either
<emilio> ... do we want to file impl bugs or call them readonly?
<emilio> q+
<emilio> TabAtkins: I know setting media attributes on link is useful
<emilio> ... and used by some tooling
<emilio> ... so I think it's useful to continue supporting it
<emilio> ... but I wouldn't shed too many tears if we call it readonly
<fantasai> emilio: I'd like to say that making conditionalText in the OM is different from what tooling does changing medi aof link
<fantasai> emilio: latter depends on ... stylesheets
<fantasai> TabAtkins: I was talking about toggling an @media rule
<fantasai> emilio: But not supported by WebKit and Blink
<fantasai> TabAtkins: Toggling *conditionText* isn't supported. But toggling mediaText *is*, though essentially a synonym
<fantasai> emilio: The media attribute on link or style element toggles the DOM attribute
<fantasai> TabAtkins: not talking about that
<fantasai> TabAtkins: talking about @media rule
<fantasai> emilio: ah, ok, that's weird
<fantasai> TabAtkins: Jonathan Neal has exploited that to toggle entire sets of rules before
<fantasai> Rossen_: So if we move to resolve on making this readonly
<fantasai> Rossen_: would there be any objections to it?
<fantasai> fantasai: I suspect in either case we need changes in implementations
<fantasai> fantasai: just a question of which way we want to go
<oriol> q+
<emilio> ack emilio
<Rossen_> q?
<fantasai> Rossen_: Forcing a normative change here would be encouraging something to change
<emilio> ScribeNick: emilio
<fantasai> fantasai: I have a PR adding tests, just haven't merged because opened this issue
<oriol> Reconnecting headset
<emilio> ack oriol
<emilio> oriol: conditionText seems analogous to selectorText for style rules and that's not read-only
<emilio> ... in the past it was not interoperable but it got fixed
<fantasai> emilio: Counter-example, we made layerName readonly
<fantasai> emilio: and generally leaning towards making OM readonly
<emilio> ... so counter-examples in both directions which is not a great state of affairs
<emilio> Rossen: So options are leave as-is and hoping tests cause browsers to change
<emilio> ... or resolve on making read-only
<emilio> ... should we do a straw-poll?
<emilio> TabAtkins: I'd prefer to make stuff consistently mutable
<bradk> +1 As is, but encourage browsers to change
<fantasai> s/mutable/mutable, given this is analogous to existing htings which are mutable/
<TabAtkins> emilio: Making @supports mutable would be a change
<TabAtkins> emilio: @media dynamically changes but @supports doesn't currently
<smfr> q+
<futhark> Existing issue for Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=1210073
<emilio> emilio: so that might be why Firefox doesn't support mutating it. In general readonly is going to be easier to get interop on
<emilio> ... but not super-strong feelings either way
<emilio> ack bradk
<emilio> bradk: I think it should be mutable
<emilio> ack smfr
<emilio> smfr: from an implementor perspective we'd like to CSSOM be more readonly, we don't have many incentives to fix these bugs
<TabAtkins> I suppose the fact that @media *does* have the .media mutable means it's okay for the .conditionText to be a readonly version that covers everyone
<bradk> A
<fantasai> 0
<emilio> strawpol: A - as-is, B - read-only
<oriol> A
<florian> 0
<emilio> B
<smfr> B
<TabAtkins> B
<futhark> B
<miriam> 0
<dholbert> 0
<jensimmons> B
<astearns> 0
<jfkthame> 0
<bradk> I don’t feel super strongly about it
<lea> Α
<delan> 0
<TYLin> A
<Morgan> 0
<rachelandrew> B
<tantek> B until there's a use-case described (didn't see it)
<Rossen_> B
<castastrophe> A
<chris> 0
<lea> Reasoning: Readonly puts undue burden on authors when they need to modify these rules to make things easier for implementors
<emilio> RESOLVED: Make conditionText readonly

webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this issue Mar 15, 2022
https://bugs.webkit.org/show_bug.cgi?id=237880

Reviewed by Antoine Quint.

LayoutTests/imported/w3c:

* web-platform-tests/interfaces/css-conditional.idl:

Source/WebCore:

Per CSSWG resolution w3c/csswg-drafts#6819 (comment)

This also matches Blink.

* css/CSSConditionRule.h:
* css/CSSConditionRule.idl:
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::setConditionText): Deleted.
* css/CSSMediaRule.h:
* css/CSSSupportsRule.cpp:
(WebCore::CSSSupportsRule::setConditionText): Deleted.
* css/CSSSupportsRule.h:



Canonical link: https://commits.webkit.org/248425@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
annulen pushed a commit to qtwebkit/qtwebkit that referenced this issue Mar 15, 2022
https://bugs.webkit.org/show_bug.cgi?id=237880

Reviewed by Antoine Quint.

LayoutTests/imported/w3c:

* web-platform-tests/interfaces/css-conditional.idl:

Source/WebCore:

Per CSSWG resolution w3c/csswg-drafts#6819 (comment)

This also matches Blink.

* css/CSSConditionRule.h:
* css/CSSConditionRule.idl:
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::setConditionText): Deleted.
* css/CSSMediaRule.h:
* css/CSSSupportsRule.cpp:
(WebCore::CSSSupportsRule::setConditionText): Deleted.
* css/CSSSupportsRule.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@291286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
emilio added a commit to emilio/csswg-drafts that referenced this issue Apr 8, 2022
emilio added a commit that referenced this issue Apr 12, 2022
@svgeesus
Copy link
Contributor

Fixed by 6c659d6

@cdoublev
Copy link
Collaborator

I think the following sentence should be removed in 7.3. The CSSMediaRule interface:

Setting the conditionText attribute must set the media.mediaText attribute on the rule.

Loirooriol added a commit to Loirooriol/servo that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
servo-wpt-sync pushed a commit to servo-wpt-sync/web-platform-tests that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
Loirooriol added a commit to Loirooriol/servo that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
servo-wpt-sync pushed a commit to servo-wpt-sync/web-platform-tests that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
Loirooriol added a commit to Loirooriol/servo that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
servo-wpt-sync pushed a commit to servo-wpt-sync/web-platform-tests that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
servo-wpt-sync pushed a commit to servo-wpt-sync/web-platform-tests that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
servo-wpt-sync pushed a commit to servo-wpt-sync/web-platform-tests that referenced this issue Nov 22, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
github-merge-queue bot pushed a commit to servo/servo that referenced this issue Nov 23, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
github-merge-queue bot pushed a commit to servo/servo that referenced this issue Nov 23, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
servo-wpt-sync pushed a commit to web-platform-tests/wpt that referenced this issue Nov 23, 2023
As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Nov 30, 2023
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Nov 30, 2023
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Nov 30, 2023
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307

UltraBlame original commit: 7f7bd8cbdf5afcaa74f452b011dc64002e4e4e7d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Nov 30, 2023
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307

UltraBlame original commit: 7f7bd8cbdf5afcaa74f452b011dc64002e4e4e7d
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Nov 30, 2023
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307

UltraBlame original commit: 7f7bd8cbdf5afcaa74f452b011dc64002e4e4e7d
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Aug 30, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Sep 23, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Oct 8, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Oct 10, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Oct 15, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Oct 28, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Nov 8, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Nov 25, 2024
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Jan 6, 2025
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Jan 30, 2025
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Feb 27, 2025
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Mar 25, 2025
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
MrAlex94 pushed a commit to BrowserWorks/Waterfox that referenced this issue Apr 24, 2025
…adonly, a=testonly

Automatic update from web-platform-tests
Make CSSConditionRule's conditionText readonly

As per w3c/csswg-drafts#6819

This will be needed for https://phabricator.services.mozilla.com/D179060

The test was created by Mozilla, but was not correctly synced into WPT.

--

wpt-commits: 9801c63eb65b11f7e584f8031c80723e6f1413b7
wpt-pr: 43307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants