Changeset 244467 in webkit
- Timestamp:
- Apr 19, 2019 2:19:57 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244462 r244467 1 2019-04-19 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 rdar://problem/49995929 6 7 Reviewed by Darin Adler. 8 9 * css-dark-mode/color-scheme-meta-expected.txt: 10 * css-dark-mode/color-scheme-meta.html: Test other types of spaces like tab, newline and vertical tab. 11 1 12 2019-04-19 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/LayoutTests/css-dark-mode/color-scheme-meta-expected.txt
r244413 r244467 19 19 PASS Color schemes changed to light,dark 20 20 PASS Element colors are in light color scheme since comma is not an allowed seperator 21 PASS Color schemes changed to foo\vdark 22 PASS Element colors are in light color scheme since vertical tab is not an allowed seperator 21 23 PASS Color schemes changed to a bogus value and dark 22 24 PASS Element colors are correct in dark color scheme with dark color scheme -
trunk/LayoutTests/css-dark-mode/color-scheme-meta.html
r244413 r244467 93 93 94 94 test(function() { 95 document.getElementById("meta").content = " light foo ";95 document.getElementById("meta").content = "\tlight foo "; 96 96 }, "Color schemes changed to light and a bogus value"); 97 97 … … 120 120 121 121 test(function() { 122 document.getElementById("meta").content = " foo dark"; 122 document.getElementById("meta").content = "foo\vdark "; 123 }, "Color schemes changed to foo\\vdark"); 124 125 test(function() { 126 // The semantic text color should be black still. 127 test_color_is_black("test1"); 128 }, "Element colors are in light color scheme since vertical tab is not an allowed seperator"); 129 130 test(function() { 131 document.getElementById("meta").content = " foo\ndark"; 123 132 }, "Color schemes changed to a bogus value and dark"); 124 133 -
trunk/Source/WebCore/ChangeLog
r244457 r244467 1 2019-04-19 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 rdar://problem/49995929 6 7 Reviewed by Darin Adler. 8 9 Tests: css-dark-mode/color-scheme-meta.html 10 11 * dom/Document.cpp: 12 (WebCore::processColorSchemeString): Use isHTMLSpace insead of isColorSchemeSeparator and isASCIISpace. 13 (WebCore::isColorSchemeSeparator): Deleted. 14 1 15 2019-04-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 16 -
trunk/Source/WebCore/dom/Document.cpp
r244440 r244467 3604 3604 3605 3605 #if ENABLE(DARK_MODE_CSS) 3606 static inline bool isColorSchemeSeparator(UChar character)3607 {3608 return isASCIISpace(character);3609 }3610 3611 3606 static void processColorSchemeString(StringView colorScheme, const WTF::Function<void(StringView key)>& callback) 3612 3607 { … … 3614 3609 for (unsigned i = 0; i < length; ) { 3615 3610 // Skip to first non-separator. 3616 while (i < length && is ColorSchemeSeparator(colorScheme[i]))3611 while (i < length && isHTMLSpace(colorScheme[i])) 3617 3612 ++i; 3618 3613 unsigned keyBegin = i; 3619 3614 3620 3615 // Skip to first separator. 3621 while (i < length && !is ColorSchemeSeparator(colorScheme[i]))3616 while (i < length && !isHTMLSpace(colorScheme[i])) 3622 3617 ++i; 3623 3618 unsigned keyEnd = i;
Note: See TracChangeset
for help on using the changeset viewer.