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 190526
Add <meta name="supported-color-schemes"> to control what color schemes the page supports
https://bugs.webkit.org/show_bug.cgi?id=190526
Summary
Add <meta name="supported-color-schemes"> to control what color schemes the p...
Timothy Hatcher
Reported
2018-10-12 10:36:46 PDT
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">
Attachments
Patch
(40.38 KB, patch)
2018-10-12 13:05 PDT
,
Timothy Hatcher
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews100 for mac-sierra
(2.35 MB, application/zip)
2018-10-12 14:18 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews106 for mac-sierra-wk2
(2.95 MB, application/zip)
2018-10-12 14:28 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews200 for win-future
(12.80 MB, application/zip)
2018-10-12 15:26 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews115 for mac-sierra
(3.04 MB, application/zip)
2018-10-12 16:04 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews121 for ios-simulator-wk2
(2.84 MB, application/zip)
2018-10-14 00:38 PDT
,
EWS Watchlist
no flags
Details
Patch
(41.40 KB, patch)
2018-10-16 11:50 PDT
,
Timothy Hatcher
no flags
Details
Formatted Diff
Diff
Archive of layout-test-results from ews107 for mac-sierra-wk2
(3.86 MB, application/zip)
2018-10-16 13:40 PDT
,
EWS Watchlist
no flags
Details
Patch
(45.74 KB, patch)
2018-10-16 13:46 PDT
,
Timothy Hatcher
no flags
Details
Formatted Diff
Diff
Show Obsolete
(8)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2018-10-12 10:37:12 PDT
<
rdar://problem/45230140
>
Simon Fraser (smfr)
Comment 2
2018-10-12 11:21:47 PDT
What's the standardization story here?
Timothy Hatcher
Comment 3
2018-10-12 13:05:52 PDT
Comment hidden (obsolete)
Created
attachment 352193
[details]
Patch
EWS Watchlist
Comment 4
2018-10-12 14:18:32 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 5
2018-10-12 14:18:34 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 6
2018-10-12 14:28:50 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 7
2018-10-12 14:28:52 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 8
2018-10-12 15:26:16 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 9
2018-10-12 15:26:28 PDT
Comment hidden (obsolete)
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
Timothy Hatcher
Comment 10
2018-10-12 15:30:39 PDT
Comment hidden (obsolete)
Wont pass until
bug 190499
lands.
EWS Watchlist
Comment 11
2018-10-12 16:04:43 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 12
2018-10-12 16:04:45 PDT
Comment hidden (obsolete)
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
Dean Jackson
Comment 13
2018-10-12 16:30:59 PDT
Comment hidden (obsolete)
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"
EWS Watchlist
Comment 14
2018-10-14 00:38:10 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 15
2018-10-14 00:38:12 PDT
Comment hidden (obsolete)
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
Timothy Hatcher
Comment 16
2018-10-15 12:21:51 PDT
Comment hidden (obsolete)
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.
Timothy Hatcher
Comment 17
2018-10-16 11:50:51 PDT
Comment hidden (obsolete)
Created
attachment 352483
[details]
Patch
EWS Watchlist
Comment 18
2018-10-16 13:40:00 PDT
Comment hidden (obsolete)
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
EWS Watchlist
Comment 19
2018-10-16 13:40:02 PDT
Comment hidden (obsolete)
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
Timothy Hatcher
Comment 20
2018-10-16 13:46:41 PDT
Created
attachment 352498
[details]
Patch
WebKit Commit Bot
Comment 21
2018-10-16 14:54:05 PDT
Comment on
attachment 352498
[details]
Patch Clearing flags on attachment: 352498 Committed
r237204
: <
https://trac.webkit.org/changeset/237204
>
WebKit Commit Bot
Comment 22
2018-10-16 14:54:07 PDT
All reviewed patches have been landed. Closing bug.
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