To know when to allow semantic colors to switch between dark and light mode, as well as form controls, we need a way for the page to tell us what color schemes they support. Proposal is to add: <meta name="supported-color-schemes" content="light dark">
<rdar://problem/45230140>
What's the standardization story here?
Created attachment 352193 [details] Patch
Comment on attachment 352193 [details] Patch Attachment 352193 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/9555486 New failing tests: css-dark-mode/supported-color-schemes.html
Created attachment 352199 [details] Archive of layout-test-results from ews100 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-sierra Platform: Mac OS X 10.12.6
Comment on attachment 352193 [details] Patch Attachment 352193 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/9555605 New failing tests: css-dark-mode/supported-color-schemes.html
Created attachment 352202 [details] Archive of layout-test-results from ews106 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Comment on attachment 352193 [details] Patch Attachment 352193 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/9556301 New failing tests: css-dark-mode/supported-color-schemes.html
Created attachment 352217 [details] Archive of layout-test-results from ews200 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews200 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Wont pass until bug 190499 lands.
Comment on attachment 352193 [details] Patch Attachment 352193 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/9556743 New failing tests: css-dark-mode/supported-color-schemes.html
Created attachment 352223 [details] Archive of layout-test-results from ews115 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-sierra Platform: Mac OS X 10.12.6
Comment on attachment 352193 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=352193&action=review > Source/WebCore/dom/Document.cpp:3575 > + i++; Why i++ here and ++i above? :) > Source/WebCore/dom/Document.cpp:3594 > + processColorSchemes(colorSchemes, [&supportedColorSchemes](StringView key) { > + if (equalLettersIgnoringASCIICase(key, "light")) > + supportedColorSchemes.add(ColorSchemes::Light); > + else if (equalLettersIgnoringASCIICase(key, "dark")) > + supportedColorSchemes.add(ColorSchemes::Dark); > + }); I like this way of doing this parsing! > Source/WebCore/dom/Document.h:898 > + enum class ColorSchemes : uint8_t { Shouldn't this be singular ColorScheme? > LayoutTests/css-dark-mode/supported-color-schemes.html:68 > + document.getElementById("meta").content = "dark"; More test suggestions " dark" "dark " "light, dark" (light should fail) "foo dark"
Comment on attachment 352193 [details] Patch Attachment 352193 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/9565309 New failing tests: css-dark-mode/supported-color-schemes.html
Created attachment 352270 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Comment on attachment 352193 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=352193&action=review >> Source/WebCore/dom/Document.cpp:3575 >> + i++; > > Why i++ here and ++i above? :) No reason. Fixed. >> Source/WebCore/dom/Document.h:898 >> + enum class ColorSchemes : uint8_t { > > Shouldn't this be singular ColorScheme? I'm not so sure. There are other cases in the code where we use plural for the enum class name. It reads better when using it too: OptionSet<ColorSchemes> >> LayoutTests/css-dark-mode/supported-color-schemes.html:68 >> + document.getElementById("meta").content = "dark"; > > More test suggestions > " dark" > "dark " > "light, dark" (light should fail) > "foo dark" I'll add more cases. "light, dark" is valid.
Created attachment 352483 [details] Patch
Comment on attachment 352483 [details] Patch Attachment 352483 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/9625960 New failing tests: css-dark-mode/supported-color-schemes.html
Created attachment 352497 [details] Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Created attachment 352498 [details] Patch
Comment on attachment 352498 [details] Patch Clearing flags on attachment: 352498 Committed r237204: <https://trac.webkit.org/changeset/237204>
All reviewed patches have been landed. Closing bug.