Title: [165655] trunk
Revision
165655
Author
[email protected]
Date
2014-03-14 14:58:35 -0700 (Fri, 14 Mar 2014)

Log Message

[CSS Shapes] CSS parser accepts trailing position arguments
https://bugs.webkit.org/show_bug.cgi?id=129514

Reviewed by Andreas Kling.

Source/WebCore:

Add a check to make sure there are no remaining function args
following a position in the circle() and ellipse() css shape
functions.

Updated existing parsing tests.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseBasicShapeCircle):
(WebCore::CSSParser::parseBasicShapeEllipse):

LayoutTests:

Add a shape with an additional argument trailing the position
in the css shapes functions.

* fast/shapes/parsing/parsing-shape-inside-expected.txt:
* fast/shapes/parsing/parsing-shape-outside-expected.txt:
* fast/shapes/parsing/parsing-test-utils.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (165654 => 165655)


--- trunk/LayoutTests/ChangeLog	2014-03-14 21:53:22 UTC (rev 165654)
+++ trunk/LayoutTests/ChangeLog	2014-03-14 21:58:35 UTC (rev 165655)
@@ -1,3 +1,17 @@
+2014-03-14  Bear Travis  <[email protected]>
+
+        [CSS Shapes] CSS parser accepts trailing position arguments
+        https://bugs.webkit.org/show_bug.cgi?id=129514
+
+        Reviewed by Andreas Kling.
+
+        Add a shape with an additional argument trailing the position
+        in the css shapes functions.
+
+        * fast/shapes/parsing/parsing-shape-inside-expected.txt:
+        * fast/shapes/parsing/parsing-shape-outside-expected.txt:
+        * fast/shapes/parsing/parsing-test-utils.js:
+
 2014-03-14  Dirk Schulze  <[email protected]>
 
         Refactor Path to Path2D and remove currentPath

Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt (165654 => 165655)


--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt	2014-03-14 21:53:22 UTC (rev 165654)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt	2014-03-14 21:58:35 UTC (rev 165655)
@@ -205,6 +205,8 @@
 PASS getComputedStyleValue("-webkit-shape-inside", "circle(at 10px 10px at center)") is "none"
 PASS getCSSText("-webkit-shape-inside", "circle(at center center 10px)") is ""
 PASS getComputedStyleValue("-webkit-shape-inside", "circle(at center center 10px)") is "none"
+PASS getCSSText("-webkit-shape-inside", "circle(at 10px 10px closest-side)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "circle(at 10px 10px closest-side)") is "none"
 PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px 30px)") is ""
 PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px 30px)") is "none"
 PASS getCSSText("-webkit-shape-inside", "ellipse(10px at 10px 10px 10px)") is ""

Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt (165654 => 165655)


--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt	2014-03-14 21:53:22 UTC (rev 165654)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt	2014-03-14 21:58:35 UTC (rev 165655)
@@ -203,6 +203,8 @@
 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px 10px at center)") is "none"
 PASS getCSSText("-webkit-shape-outside", "circle(at center center 10px)") is ""
 PASS getComputedStyleValue("-webkit-shape-outside", "circle(at center center 10px)") is "none"
+PASS getCSSText("-webkit-shape-outside", "circle(at 10px 10px closest-side)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px 10px closest-side)") is "none"
 PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px 30px)") is ""
 PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px 30px)") is "none"
 PASS getCSSText("-webkit-shape-outside", "ellipse(10px at 10px 10px 10px)") is ""

Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js (165654 => 165655)


--- trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js	2014-03-14 21:53:22 UTC (rev 165654)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js	2014-03-14 21:58:35 UTC (rev 165655)
@@ -118,6 +118,7 @@
     "circle(at 10px 10px 10px)",
     "circle(at 10px 10px at center)",
     "circle(at center center 10px)",
+    "circle(at 10px 10px closest-side)",
 
     "ellipse(10px 20px 30px)",
     "ellipse(10px at 10px 10px 10px)",

Modified: trunk/Source/WebCore/ChangeLog (165654 => 165655)


--- trunk/Source/WebCore/ChangeLog	2014-03-14 21:53:22 UTC (rev 165654)
+++ trunk/Source/WebCore/ChangeLog	2014-03-14 21:58:35 UTC (rev 165655)
@@ -1,3 +1,20 @@
+2014-03-14  Bear Travis  <[email protected]>
+
+        [CSS Shapes] CSS parser accepts trailing position arguments
+        https://bugs.webkit.org/show_bug.cgi?id=129514
+
+        Reviewed by Andreas Kling.
+
+        Add a check to make sure there are no remaining function args
+        following a position in the circle() and ellipse() css shape
+        functions.
+
+        Updated existing parsing tests.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseBasicShapeCircle):
+        (WebCore::CSSParser::parseBasicShapeEllipse):
+
 2014-03-14  Simon Fraser  <[email protected]>
 
         Fix the iOS build and sort the exports file.

Modified: trunk/Source/WebCore/css/CSSParser.cpp (165654 => 165655)


--- trunk/Source/WebCore/css/CSSParser.cpp	2014-03-14 21:53:22 UTC (rev 165654)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2014-03-14 21:58:35 UTC (rev 165655)
@@ -5510,7 +5510,7 @@
             RefPtr<CSSValue> centerY;
             args->next(); // set list to start of position center
             parseFillPosition(args, centerX, centerY);
-            if (centerX && centerY) {
+            if (centerX && centerY && !args->current()) {
                 ASSERT(centerX->isPrimitiveValue());
                 ASSERT(centerY->isPrimitiveValue());
                 shape->setCenterX(toCSSPrimitiveValue(centerX.get()));
@@ -5561,7 +5561,7 @@
         RefPtr<CSSValue> centerY;
         args->next(); // set list to start of position center
         parseFillPosition(args, centerX, centerY);
-        if (!centerX || !centerY)
+        if (!centerX || !centerY || args->current())
             return 0;
 
         ASSERT(centerX->isPrimitiveValue());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to