See https://github.com/w3c/csswg-drafts/issues/3857#issuecomment-634779976 and https://groups.google.com/a/chromium.org/d/msg/blink-dev/3RhZFvZE1LM/t7BpLBWkAwAJ
Created attachment 427530 [details] Patch
Comment on attachment 427530 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427530&action=review > Source/WebCore/css/MediaQueryEvaluator.cpp:-811 > switch (keyword) { > - case CSSValueNoPreference: > - return false; The default for this switch is false so this doesn't seem to change anything at all.
Comment on attachment 427530 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427530&action=review > LayoutTests/css-dark-mode/older-systems/prefers-color-scheme.html:25 > -@media (prefers-color-scheme: no-preference) { > +@media not (prefers-color-scheme) { We may need to keep supporting 'no-preference' value even when parsing is fixed.
Comment on attachment 427530 [details] Patch I don't know if it is ok to remove 'no-preference' support but if it is, it can be done after the parsing fix. It should also be done properly by removing all the code, not by stealth test changes.
Comment on attachment 427530 [details] Patch Regarding tests: the test already tests for `foo` which is the invalid keyword case (like `no-preference`). WPT also has coverage for `no-preference`: https://wpt.fyi/results/css/mediaqueries/prefers-color-scheme.html?label=master&label=experimental&aligned&q=prefers-color-scheme Regarding removing all the code: CSSValueNoPreference can't be removed since other MQ use it (prefers-contrast/prefers-reduced-motion).
Tim Hatcher says getting rid of this is ok.
Committed r276908 (237253@main): <https://commits.webkit.org/237253@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427530 [details].
<rdar://problem/77461590>