Skip to content
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

[css-mediaqueries] @media (scripting: initial-only) is weird #8621

Open
emilio opened this issue Mar 20, 2023 · 7 comments
Open

[css-mediaqueries] @media (scripting: initial-only) is weird #8621

emilio opened this issue Mar 20, 2023 · 7 comments

Comments

@emilio
Copy link
Collaborator

emilio commented Mar 20, 2023

When is it supposed to match on browsers? When printing? But on implementations either reuse the document (which means script is paused, but will run again), or clone the document (which means they never run script on such document, though we probably want to match scripting: enabled to match the non-print media).

I think we could probably do without this value. I'm personally unsure on when would it be useful on browsers, though if there's a strong use-case from embedded / PDF renderers / etc I suppose we could match it.

wdyt, @frivoal?

@emilio emilio changed the title @media (scripting: initial-only) is weird [css-mediaqueries] @media (scripting: initial-only) is weird Mar 20, 2023
@tabatkins
Copy link
Member

It shouldn't ever match in browsers. They either run script or not, they don't have an initial phase.

@CanadaHonk
Copy link
Contributor

CanadaHonk commented Mar 24, 2023

@tabatkins In what situations would it match? It mentioned printing, does it mean actual printer devices, or?

Examples are printed pages, or pre-rendering network proxies that render a page on a server and send a nearly-static version of the page to the user.

@tabatkins
Copy link
Member

Yeah, like book printing.

@emilio emilio removed the Agenda+ label Mar 24, 2023
@emilio
Copy link
Collaborator Author

emilio commented Mar 24, 2023

Okay, a note in the spec to that regard would be useful but otherwise I'm ok with close-no-change.

@sideshowbarker
Copy link
Contributor

I notice Firefox passes the “Check that scripting currently matches 'enabled'” test case in https://wpt.live/css/mediaqueries/scripting.html — which I wouldn’t expect it to if it weren’t matching. Am I misunderstanding what that’s testing?

@CanadaHonk
Copy link
Contributor

CanadaHonk commented Aug 21, 2023

@sideshowbarker I added support for @media (scripting) in Gecko (and those WPTs) in March. Phab and intent to ship, if confused why it seems supported. Otherwise, it should match 'enabled' since (I presume) JavaScript is on in Firefox.

@sideshowbarker
Copy link
Contributor

@sideshowbarker I added support for @media (scripting) in Gecko (and those WPTs) in March. Phab and intent to ship, if confused why it seems supported. Otherwise, it should match 'enabled' since (I presume) JavaScript is on in Firefox.

Thanks much. I’d been trying to figure out how to get the Firefox behavior in WebKit — and from looking at that Gecko patch, it’s clear to me now how to do that.

sideshowbarker added a commit to sideshowbarker/WebKit that referenced this issue Aug 22, 2023
Reviewed by NOBODY (OOPS!).

w3c/csswg-drafts#8621

* LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/scripting-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/mediaqueries/scripting.html:
* Source/WebCore/css/query/MediaQueryFeatures.cpp:
(WebCore::MQ::Features::scripting):
webkit-commit-queue pushed a commit to sideshowbarker/WebKit that referenced this issue Aug 23, 2023
https://bugs.webkit.org/show_bug.cgi?id=260432

Reviewed by Tim Nguyen.

w3c/csswg-drafts#8621

* LayoutTests/fast/css/media-query-scripting-initial-only-expected.html: Added.
* LayoutTests/fast/css/media-query-scripting-initial-only.html: Added.
* Source/WebCore/css/query/MediaQueryFeatures.cpp:
(WebCore::MQ::Features::scripting):

Canonical link: https://commits.webkit.org/267198@main
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

4 participants