Title: [114444] trunk/Source/WebCore
Revision
114444
Author
macpher...@chromium.org
Date
2012-04-17 15:16:55 -0700 (Tue, 17 Apr 2012)

Log Message

Clean up CSSParser::parseFillRepeat().
https://bugs.webkit.org/show_bug.cgi?id=83547

Reviewed by Kentaro Hara.

Removed multiple unnecessary calls to m_valueList->current().
Restructured logic for parsing second value to make it clearer.

No new tests / code cleanup only.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114443 => 114444)


--- trunk/Source/WebCore/ChangeLog	2012-04-17 22:15:54 UTC (rev 114443)
+++ trunk/Source/WebCore/ChangeLog	2012-04-17 22:16:55 UTC (rev 114444)
@@ -1,3 +1,18 @@
+2012-04-17  Luke Macpherson  <macpher...@chromium.org>
+
+        Clean up CSSParser::parseFillRepeat().
+        https://bugs.webkit.org/show_bug.cgi?id=83547
+
+        Reviewed by Kentaro Hara.
+
+        Removed multiple unnecessary calls to m_valueList->current().
+        Restructured logic for parsing second value to make it clearer.
+
+        No new tests / code cleanup only.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseFillRepeat):
+
 2012-04-17  Kentaro Hara  <hara...@chromium.org>
 
         [V8] Pass Isolate to toV8Slow()

Modified: trunk/Source/WebCore/css/CSSParser.cpp (114443 => 114444)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-04-17 22:15:54 UTC (rev 114443)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-04-17 22:16:55 UTC (rev 114444)
@@ -3300,8 +3300,6 @@
 
 void CSSParser::parseFillRepeat(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2)
 {
-    CSSParserValue* value = m_valueList->current();
-
     int id = m_valueList->current()->id;
     if (id == CSSValueRepeatX) {
         m_implicitShorthand = true;
@@ -3324,23 +3322,21 @@
         return;
     }
 
-    value = m_valueList->next();
+    CSSParserValue* value = m_valueList->next();
 
-    // First check for the comma.  If so, we are finished parsing this value or value pair.
-    if (isComma(value))
-        value = 0;
-
-    if (value)
-        id = m_valueList->current()->id;
-
-    if (value && (id == CSSValueRepeat || id == CSSValueNoRepeat || id == CSSValueRound || id == CSSValueSpace)) {
-        value2 = cssValuePool().createIdentifierValue(id);
-        m_valueList->next();
-    } else {
-        // If only one value was specified, value2 is the same as value1.
-        m_implicitShorthand = true;
-        value2 = cssValuePool().createIdentifierValue(static_cast<CSSPrimitiveValue*>(value1.get())->getIdent());
+    // Parse the second value if one is available
+    if (value && !isComma(value)) {
+        id = value->id;
+        if (id == CSSValueRepeat || id == CSSValueNoRepeat || id == CSSValueRound || id == CSSValueSpace) {
+            value2 = cssValuePool().createIdentifierValue(id);
+            m_valueList->next();
+            return;
+        }
     }
+
+    // If only one value was specified, value2 is the same as value1.
+    m_implicitShorthand = true;
+    value2 = cssValuePool().createIdentifierValue(static_cast<CSSPrimitiveValue*>(value1.get())->getIdent());
 }
 
 PassRefPtr<CSSValue> CSSParser::parseFillSize(CSSPropertyID propId, bool& allowComma)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to