Patch parseKeywordValue to accept "unset" so that it goes down the faster parsing...
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Oct 2015 00:18:35 +0000 (00:18 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Oct 2015 00:18:35 +0000 (00:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150213

Reviewed by Dean Jackson.

No new tests as correctness doesn't change (just speed).

* css/CSSParser.cpp:
(WebCore::parseKeywordValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp

index 625bf69..e54716d 100644 (file)
@@ -1,5 +1,17 @@
 2015-10-15  David Hyatt  <hyatt@apple.com>
 
+        Patch parseKeywordValue to accept "unset" so that it goes down the faster parsing path.
+        https://bugs.webkit.org/show_bug.cgi?id=150213
+
+        Reviewed by Dean Jackson.
+
+        No new tests as correctness doesn't change (just speed).
+
+        * css/CSSParser.cpp:
+        (WebCore::parseKeywordValue):
+
+2015-10-15  David Hyatt  <hyatt@apple.com>
+
         Add support for the CSS 'unset' keyword.
         https://bugs.webkit.org/show_bug.cgi?id=148614
 
index ae0e8cf..cfb9bd9 100644 (file)
@@ -1197,10 +1197,10 @@ static CSSParser::ParseResult parseKeywordValue(MutableStyleProperties* declarat
     if (!isKeywordPropertyID(propertyId)) {
         // All properties accept the values of "initial" and "inherit".
         String lowerCaseString = string.lower();
-        if (lowerCaseString != "initial" && lowerCaseString != "inherit")
+        if (lowerCaseString != "initial" && lowerCaseString != "inherit" && lowerCaseString != "unset")
             return CSSParser::ParseResult::Error;
 
-        // Parse initial/inherit shorthands using the CSSParser.
+        // Parse initial/inherit/unset shorthands using the CSSParser.
         if (shorthandForProperty(propertyId).length())
             return CSSParser::ParseResult::Error;
     }