Diff
Modified: trunk/LayoutTests/ChangeLog (244412 => 244413)
--- trunk/LayoutTests/ChangeLog 2019-04-17 23:47:16 UTC (rev 244412)
+++ trunk/LayoutTests/ChangeLog 2019-04-17 23:55:47 UTC (rev 244413)
@@ -1,5 +1,17 @@
2019-04-17 Timothy Hatcher <[email protected]>
+ Standardize the `<meta name="color-scheme">` separator.
+ https://bugs.webkit.org/show_bug.cgi?id=193931
+
+ Reviewed by Simon Fraser.
+
+ * css-dark-mode/color-scheme-meta-expected.txt:
+ * css-dark-mode/color-scheme-meta.html:
+ * css-dark-mode/older-syntax/supported-color-scheme-meta-expected.txt:
+ * css-dark-mode/older-syntax/supported-color-schemes-meta.html:
+
+2019-04-17 Timothy Hatcher <[email protected]>
+
Rename `supported-color-schemes` to `color-scheme`.
https://bugs.webkit.org/show_bug.cgi?id=197016
rdar://problem/49980259
Modified: trunk/LayoutTests/css-dark-mode/color-scheme-meta-expected.txt (244412 => 244413)
--- trunk/LayoutTests/css-dark-mode/color-scheme-meta-expected.txt 2019-04-17 23:47:16 UTC (rev 244412)
+++ trunk/LayoutTests/css-dark-mode/color-scheme-meta-expected.txt 2019-04-17 23:55:47 UTC (rev 244413)
@@ -16,8 +16,8 @@
PASS Element colors are correct in dark color scheme with only light color scheme
PASS Color schemes changed to empty value
PASS Element colors are correct in dark color scheme with implicit light color scheme
-PASS Color schemes changed to light and dark
-PASS Element colors are correct in dark color scheme with light and dark color scheme
+PASS Color schemes changed to light,dark
+PASS Element colors are in light color scheme since comma is not an allowed seperator
PASS Color schemes changed to a bogus value and dark
PASS Element colors are correct in dark color scheme with dark color scheme
Modified: trunk/LayoutTests/css-dark-mode/color-scheme-meta.html (244412 => 244413)
--- trunk/LayoutTests/css-dark-mode/color-scheme-meta.html 2019-04-17 23:47:16 UTC (rev 244412)
+++ trunk/LayoutTests/css-dark-mode/color-scheme-meta.html 2019-04-17 23:55:47 UTC (rev 244413)
@@ -92,7 +92,7 @@
}, "Element colors are correct in dark color scheme with only dark color scheme");
test(function() {
- document.getElementById("meta").content = "light ,foo ";
+ document.getElementById("meta").content = "light foo ";
}, "Color schemes changed to light and a bogus value");
test(function() {
@@ -110,16 +110,16 @@
}, "Element colors are correct in dark color scheme with implicit light color scheme");
test(function() {
- document.getElementById("meta").content = " light, dark ";
-}, "Color schemes changed to light and dark");
+ document.getElementById("meta").content = " light,dark ";
+}, "Color schemes changed to light,dark");
test(function() {
- // The semantic text color should be white now.
- test_color_is_white("test1");
-}, "Element colors are correct in dark color scheme with light and dark color scheme");
+ // The semantic text color should be black now.
+ test_color_is_black("test1");
+}, "Element colors are in light color scheme since comma is not an allowed seperator");
test(function() {
- document.getElementById("meta").content = ", foo dark";
+ document.getElementById("meta").content = " foo dark";
}, "Color schemes changed to a bogus value and dark");
test(function() {
Modified: trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt (244412 => 244413)
--- trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt 2019-04-17 23:47:16 UTC (rev 244412)
+++ trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt 2019-04-17 23:55:47 UTC (rev 244413)
@@ -16,8 +16,8 @@
PASS Element colors are correct in dark color scheme with only light color scheme
PASS Supported color schemes changed to empty value
PASS Element colors are correct in dark color scheme with implicit light color scheme
-PASS Supported color schemes changed to light and dark
-PASS Element colors are correct in dark color scheme with light and dark color scheme
+PASS Supported color schemes changed to light,dark
+PASS Element colors are in light color scheme since comma is not an allowed seperator
PASS Supported color schemes changed to a bogus value and dark
PASS Element colors are correct in dark color scheme with dark color scheme
Modified: trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta.html (244412 => 244413)
--- trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta.html 2019-04-17 23:47:16 UTC (rev 244412)
+++ trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta.html 2019-04-17 23:55:47 UTC (rev 244413)
@@ -110,16 +110,16 @@
}, "Element colors are correct in dark color scheme with implicit light color scheme");
test(function() {
- document.getElementById("meta").content = " light, dark ";
-}, "Supported color schemes changed to light and dark");
+ document.getElementById("meta").content = " light,dark ";
+}, "Supported color schemes changed to light,dark");
test(function() {
- // The semantic text color should be white now.
- test_color_is_white("test1");
-}, "Element colors are correct in dark color scheme with light and dark color scheme");
+ // The semantic text color should be black now.
+ test_color_is_black("test1");
+}, "Element colors are in light color scheme since comma is not an allowed seperator");
test(function() {
- document.getElementById("meta").content = ", foo dark";
+ document.getElementById("meta").content = " foo dark";
}, "Supported color schemes changed to a bogus value and dark");
test(function() {
Modified: trunk/Source/WebCore/ChangeLog (244412 => 244413)
--- trunk/Source/WebCore/ChangeLog 2019-04-17 23:47:16 UTC (rev 244412)
+++ trunk/Source/WebCore/ChangeLog 2019-04-17 23:55:47 UTC (rev 244413)
@@ -1,5 +1,21 @@
2019-04-17 Timothy Hatcher <[email protected]>
+ Standardize the `<meta name="color-scheme">` separator.
+ https://bugs.webkit.org/show_bug.cgi?id=193931
+
+ Reviewed by Simon Fraser.
+
+ Drop support for comma as a valid seperator in <meta name="color-scheme"> to
+ match the proposal being tracked by: https://github.com/whatwg/html/issues/4504
+
+ Tests: css-dark-mode/color-scheme-meta.html
+ css-dark-mode/older-syntax/supported-color-schemes-meta.html
+
+ * dom/Document.cpp:
+ (WebCore::isColorSchemeSeparator): Drop support for comma.
+
+2019-04-17 Timothy Hatcher <[email protected]>
+
Rename `supported-color-schemes` to `color-scheme`.
https://bugs.webkit.org/show_bug.cgi?id=197016
rdar://problem/49980259
Modified: trunk/Source/WebCore/dom/Document.cpp (244412 => 244413)
--- trunk/Source/WebCore/dom/Document.cpp 2019-04-17 23:47:16 UTC (rev 244412)
+++ trunk/Source/WebCore/dom/Document.cpp 2019-04-17 23:55:47 UTC (rev 244413)
@@ -3616,9 +3616,9 @@
}
#if ENABLE(DARK_MODE_CSS)
-static bool isColorSchemeSeparator(UChar character)
+static inline bool isColorSchemeSeparator(UChar character)
{
- return isASCIISpace(character) || character == ',';
+ return isASCIISpace(character);
}
static void processColorSchemeString(StringView colorScheme, const WTF::Function<void(StringView key)>& callback)