WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 225282
Invalid media query keyword values should not be parsable
https://bugs.webkit.org/show_bug.cgi?id=225282
Summary
Invalid media query keyword values should not be parsable
Tim Nguyen (:ntim)
Reported
2021-05-02 10:02:42 PDT
Examples: prefers-color-scheme: none prefers-color-scheme: aghadshudfsjhdsfkjhdsfdsfa prefers-color-scheme: visible prefers-color-scheme: hidden prefers-color-scheme: -webkit-sticky prefers-color-scheme: cssisawesome Ditto for prefers-contrast WebKit all considers them as parsable... This shows up in our WPT failures (notably the none cases for prefers-contrast/prefers-color-scheme). Example snippet to reproduce: function query_is_css_parseable(query) { const style = document.createElement('style'); style.type = 'text/css'; document.head.appendChild(style); const sheet = style.sheet; try { sheet.insertRule("@media " + query + "{}", 0); return sheet.cssRules.length == 1 && sheet.cssRules[0].media.mediaText != "not all"; } finally { while (sheet.cssRules.length) sheet.deleteRule(0); style.remove(); } } query_is_css_parseable("(prefers-color-scheme: -webkit-sticky)") // should return false
Attachments
Patch
(9.37 KB, patch)
2021-05-05 11:22 PDT
,
Tim Nguyen (:ntim)
dino
: review+
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Tim Nguyen (:ntim)
Comment 1
2021-05-05 11:22:07 PDT
Created
attachment 427783
[details]
Patch
Radar WebKit Bug Importer
Comment 2
2021-05-05 11:22:36 PDT
<
rdar://problem/77566627
>
Dean Jackson
Comment 3
2021-05-05 11:31:26 PDT
In the future we might want to do this with generated code, the way we do with properties.
Tim Nguyen (:ntim)
Comment 4
2021-05-05 13:41:54 PDT
Committed
r277039
(
237352@main
): <
https://commits.webkit.org/237352@main
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug