Title: [209389] trunk/Source/WebCore
Revision
209389
Author
[email protected]
Date
2016-12-05 23:34:35 -0800 (Mon, 05 Dec 2016)

Log Message

[CSS Parser] Reject invalid hex colors on the fast path
https://bugs.webkit.org/show_bug.cgi?id=165461

Reviewed by Zalan Bujtas.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::fastParseColorInternal):
Make sure to check for success. There was even a FIXME in the code about this!
Matches our old parser's behavior.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (209388 => 209389)


--- trunk/Source/WebCore/ChangeLog	2016-12-06 06:55:43 UTC (rev 209388)
+++ trunk/Source/WebCore/ChangeLog	2016-12-06 07:34:35 UTC (rev 209389)
@@ -1,3 +1,15 @@
+2016-12-05  Dave Hyatt  <[email protected]>
+
+        [CSS Parser] Reject invalid hex colors on the fast path
+        https://bugs.webkit.org/show_bug.cgi?id=165461
+
+        Reviewed by Zalan Bujtas.
+
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::fastParseColorInternal):
+        Make sure to check for success. There was even a FIXME in the code about this!
+        Matches our old parser's behavior.
+
 2016-12-05  Antoine Quint  <[email protected]>
 
         [Modern Media Controls] Controls bar in fullscreen cannot be dragged

Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (209388 => 209389)


--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2016-12-06 06:55:43 UTC (rev 209388)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2016-12-06 07:34:35 UTC (rev 209389)
@@ -419,10 +419,9 @@
     CSSPrimitiveValue::UnitTypes expect = CSSPrimitiveValue::UnitTypes::CSS_UNKNOWN;
 
     if (length >= 4 && characters[0] == '#') {
-        // FIXME: Why doesn't this check if the parse worked? Is the fallback black?
         RGBA32 rgb;
-        Color::parseHexColor(characters + 1, length - 1, rgb);
-        return Color(rgb);
+        if (Color::parseHexColor(characters + 1, length - 1, rgb))
+            return Color(rgb);
     }
 
     if (quirksMode && (length == 3 || length == 6)) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to