Changeset 244413 in webkit


Ignore:
Timestamp:
Apr 17, 2019 4:55:47 PM (5 years ago)
Author:
timothy@apple.com
Message:

Standardize the <meta name="color-scheme"> separator.
https://bugs.webkit.org/show_bug.cgi?id=193931

Reviewed by Simon Fraser.

Source/WebCore:

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.

LayoutTests:

  • 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:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r244408 r244413  
     12019-04-17  Timothy Hatcher  <timothy@apple.com>
     2
     3        Standardize the `<meta name="color-scheme">` separator.
     4        https://bugs.webkit.org/show_bug.cgi?id=193931
     5
     6        Reviewed by Simon Fraser.
     7
     8        * css-dark-mode/color-scheme-meta-expected.txt:
     9        * css-dark-mode/color-scheme-meta.html:
     10        * css-dark-mode/older-syntax/supported-color-scheme-meta-expected.txt:
     11        * css-dark-mode/older-syntax/supported-color-schemes-meta.html:
     12
    1132019-04-17  Timothy Hatcher  <timothy@apple.com>
    214
  • trunk/LayoutTests/css-dark-mode/color-scheme-meta-expected.txt

    r244408 r244413  
    1717PASS Color schemes changed to empty value
    1818PASS Element colors are correct in dark color scheme with implicit light color scheme
    19 PASS Color schemes changed to light and dark
    20 PASS Element colors are correct in dark color scheme with light and dark color scheme
     19PASS Color schemes changed to light,dark
     20PASS Element colors are in light color scheme since comma is not an allowed seperator
    2121PASS Color schemes changed to a bogus value and dark
    2222PASS Element colors are correct in dark color scheme with dark color scheme
  • trunk/LayoutTests/css-dark-mode/color-scheme-meta.html

    r244408 r244413  
    9393
    9494test(function() {
    95     document.getElementById("meta").content = "light ,foo ";
     95    document.getElementById("meta").content = "light  foo ";
    9696}, "Color schemes changed to light and a bogus value");
    9797
     
    111111
    112112test(function() {
    113     document.getElementById("meta").content = "   light, dark ";
    114 }, "Color schemes changed to light and dark");
     113    document.getElementById("meta").content = "   light,dark ";
     114}, "Color schemes changed to light,dark");
    115115
    116116test(function() {
    117     // The semantic text color should be white now.
    118     test_color_is_white("test1");
    119 }, "Element colors are correct in dark color scheme with light and dark color scheme");
     117    // The semantic text color should be black now.
     118    test_color_is_black("test1");
     119}, "Element colors are in light color scheme since comma is not an allowed seperator");
    120120
    121121test(function() {
    122     document.getElementById("meta").content = ", foo dark";
     122    document.getElementById("meta").content = "  foo dark";
    123123}, "Color schemes changed to a bogus value and dark");
    124124
  • trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta-expected.txt

    r244408 r244413  
    1717PASS Supported color schemes changed to empty value
    1818PASS Element colors are correct in dark color scheme with implicit light color scheme
    19 PASS Supported color schemes changed to light and dark
    20 PASS Element colors are correct in dark color scheme with light and dark color scheme
     19PASS Supported color schemes changed to light,dark
     20PASS Element colors are in light color scheme since comma is not an allowed seperator
    2121PASS Supported color schemes changed to a bogus value and dark
    2222PASS Element colors are correct in dark color scheme with dark color scheme
  • trunk/LayoutTests/css-dark-mode/older-syntax/supported-color-schemes-meta.html

    r244408 r244413  
    111111
    112112test(function() {
    113     document.getElementById("meta").content = "   light, dark ";
    114 }, "Supported color schemes changed to light and dark");
     113    document.getElementById("meta").content = "   light,dark ";
     114}, "Supported color schemes changed to light,dark");
    115115
    116116test(function() {
    117     // The semantic text color should be white now.
    118     test_color_is_white("test1");
    119 }, "Element colors are correct in dark color scheme with light and dark color scheme");
     117    // The semantic text color should be black now.
     118    test_color_is_black("test1");
     119}, "Element colors are in light color scheme since comma is not an allowed seperator");
    120120
    121121test(function() {
    122     document.getElementById("meta").content = ", foo dark";
     122    document.getElementById("meta").content = "  foo dark";
    123123}, "Supported color schemes changed to a bogus value and dark");
    124124
  • trunk/Source/WebCore/ChangeLog

    r244408 r244413  
     12019-04-17  Timothy Hatcher  <timothy@apple.com>
     2
     3        Standardize the `<meta name="color-scheme">` separator.
     4        https://bugs.webkit.org/show_bug.cgi?id=193931
     5
     6        Reviewed by Simon Fraser.
     7
     8        Drop support for comma as a valid seperator in <meta name="color-scheme"> to
     9        match the proposal being tracked by: https://github.com/whatwg/html/issues/4504
     10
     11        Tests: css-dark-mode/color-scheme-meta.html
     12               css-dark-mode/older-syntax/supported-color-schemes-meta.html
     13
     14        * dom/Document.cpp:
     15        (WebCore::isColorSchemeSeparator): Drop support for comma.
     16
    1172019-04-17  Timothy Hatcher  <timothy@apple.com>
    218
  • trunk/Source/WebCore/dom/Document.cpp

    r244408 r244413  
    36173617
    36183618#if ENABLE(DARK_MODE_CSS)
    3619 static bool isColorSchemeSeparator(UChar character)
    3620 {
    3621     return isASCIISpace(character) || character == ',';
     3619static inline bool isColorSchemeSeparator(UChar character)
     3620{
     3621    return isASCIISpace(character);
    36223622}
    36233623
Note: See TracChangeset for help on using the changeset viewer.