Title: [137007] trunk
Revision
137007
Author
[email protected]
Date
2012-12-07 18:34:01 -0800 (Fri, 07 Dec 2012)

Log Message

Enable CSS3 position offset for CSS Masking.
https://bugs.webkit.org/show_bug.cgi?id=104252

Reviewed by Dirk Schulze.

Source/WebCore:

To follow CSS3 background-position, mask-position should also support
the new <position> type (http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#mask-property).
Now the code is shared between background and mask I renamed the
functions used to be more generic. Note that the feature flag is not
meant to stay and will be removed in a following commit.

No new tests : I modified LayoutTests/fast/masking/parsing-mask.html to
cover the new feature.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createPositionListForLayer):
* css/CSSParser.cpp:
(WebCore::isFillPositionKeyword):
(WebCore::CSSParser::parse4ValuesFillPosition):
(WebCore::CSSParser::parse3ValuesFillPosition):
(WebCore::CSSParser::isPotentialPositionValue):
(WebCore::CSSParser::parseFillPosition):
(WebCore::CSSParser::parse2ValuesFillPosition):
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::parseTransformOriginShorthand):
(WebCore::CSSParser::parseRadialGradient):
(WebCore::CSSParser::parsePerspectiveOrigin):
* css/CSSParser.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):

LayoutTests:

Add coverage for the new cases. Both when setting the position with the
longhand or with the shorthand.

* fast/masking/parsing-mask-expected.txt:
* fast/masking/parsing-mask.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137006 => 137007)


--- trunk/LayoutTests/ChangeLog	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/LayoutTests/ChangeLog	2012-12-08 02:34:01 UTC (rev 137007)
@@ -1,3 +1,16 @@
+2012-12-07  Alexis Menard  <[email protected]>
+
+        Enable CSS3 position offset for CSS Masking.
+        https://bugs.webkit.org/show_bug.cgi?id=104252
+
+        Reviewed by Dirk Schulze.
+
+        Add coverage for the new cases. Both when setting the position with the
+        longhand or with the shorthand.
+
+        * fast/masking/parsing-mask-expected.txt:
+        * fast/masking/parsing-mask.html:
+
 2012-12-07  No'am Rosenthal  <[email protected]>
 
         Use background color for GraphicsLayers when applicable

Modified: trunk/LayoutTests/fast/masking/parsing-mask-expected.txt (137006 => 137007)


--- trunk/LayoutTests/fast/masking/parsing-mask-expected.txt	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/LayoutTests/fast/masking/parsing-mask-expected.txt	2012-12-08 02:34:01 UTC (rev 137007)
@@ -24,6 +24,21 @@
 PASS innerStyle("-webkit-mask", "50px 50%") is "50px 50%"
 PASS innerStyle("-webkit-mask", "center left") is "0% 50%"
 PASS innerStyle("-webkit-mask", "top center") is "50% 0%"
+PASS innerStyle("-webkit-mask", "left 10px top 15px") is "left 10px top 15px"
+PASS innerStyle("-webkit-mask", "left 10% top 30%") is "left 10% top 30%"
+PASS innerStyle("-webkit-mask", "right top 15px") is "right 0% top 15px"
+PASS innerStyle("-webkit-mask", "left 10px center") is "left 10px top 50%"
+PASS innerStyle("-webkit-mask", "center top 20px") is "left 50% top 20px"
+PASS innerStyle("-webkit-mask", "center left 30px") is "left 30px top 50%"
+PASS innerStyle("-webkit-mask", "left 20% top") is "left 20% top 0%"
+PASS innerStyle("-webkit-mask", "center center") is "50% 50%"
+PASS innerStyle("-webkit-mask-position", "left 10px top 15px") is "left 10px top 15px"
+PASS innerStyle("-webkit-mask-position", "left 10% top 30%") is "left 10% top 30%"
+PASS innerStyle("-webkit-mask-position", "right top 15px") is "right 0% top 15px"
+PASS innerStyle("-webkit-mask-position", "left 10px center") is "left 10px top 50%"
+PASS innerStyle("-webkit-mask-position", "center top 20px") is "left 50% top 20px"
+PASS innerStyle("-webkit-mask-position", "center left 30px") is "left 30px top 50%"
+PASS innerStyle("-webkit-mask-position", "left 20% top") is "left 20% top 0%"
 PASS innerStyle("-webkit-mask", "repeat-x") is "repeat-x"
 PASS innerStyle("-webkit-mask", "repeat-y") is "repeat-y"
 PASS innerStyle("-webkit-mask", "repeat") is "repeat"
@@ -52,12 +67,17 @@
 PASS innerStyle("-webkit-mask", "none left top / auto 0%") is "none 0% 0% / auto 0%"
 PASS innerStyle("-webkit-mask", "none left top / cover") is "none 0% 0% / cover"
 PASS innerStyle("-webkit-mask", "none left top / contain") is "none 0% 0% / contain"
+PASS innerStyle("-webkit-mask", "none left 20px top 10px / contain") is "none left 20px top 10px / contain"
+PASS innerStyle("-webkit-mask", "none left 20px top / contain") is "none left 20px top 0% / contain"
 PASS innerStyle("-webkit-mask", "none padding-box content-box") is "none padding-box content-box"
 PASS innerStyle("-webkit-mask", "none padding-box") is "none padding-box padding-box"
 PASS innerStyle("-webkit-mask", "none top") is "none 50% 0%"
+PASS innerStyle("-webkit-mask", "none center right 20px") is "none right 20px top 50%"
 PASS innerStyle("-webkit-mask", "none border-box left top") is "none 0% 0% border-box border-box"
+PASS innerStyle("-webkit-mask", "none border-box left top 20px") is "none left 0% top 20px border-box border-box"
 PASS innerStyle("-webkit-mask", "none border-box content-box left top repeat-x") is "none 0% 0% repeat-x border-box content-box"
 PASS innerStyle("-webkit-mask", "none border-box content-box left top / auto repeat-x") is "none 0% 0% / auto repeat-x border-box content-box"
+PASS innerStyle("-webkit-mask", "none border-box content-box right 0px center / auto repeat-x") is "none right 0px top 50% / auto repeat-x border-box content-box"
 PASS innerStyle("-webkit-mask", "top none left") is null
 PASS innerStyle("-webkit-mask", "right none bottom") is null
 PASS innerStyle("-webkit-mask", "right right") is null
@@ -79,6 +99,16 @@
 PASS innerStyle("-webkit-mask", "space scroll") is null
 PASS innerStyle("-webkit-mask", "none scroll") is null
 PASS innerStyle("-webkit-mask", "none top left / auto repeat-x scroll border-box border-box") is null
+PASS innerStyle("-webkit-mask", "right top left") is null
+PASS innerStyle("-webkit-mask", "center left center") is null
+PASS innerStyle("-webkit-mask", "center top center") is null
+PASS innerStyle("-webkit-mask", "center right bottom") is null
+PASS innerStyle("-webkit-mask", "top solid bottom") is null
+PASS innerStyle("-webkit-mask", "none top left right center top / auto repeat-x scroll border-box border-box") is null
+PASS innerStyle("-webkit-mask", "none center center 20px / auto repeat-x scroll border-box border-box") is null
+PASS innerStyle("-webkit-mask", "none top 20px right 30px center / auto repeat-x scroll border-box border-box") is null
+PASS innerStyle("-webkit-mask", "none top 20px top 30px / auto repeat-x scroll border-box border-box") is null
+PASS innerStyle("-webkit-mask", "none top 20px bottom / auto repeat-x scroll border-box border-box") is null
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/masking/parsing-mask.html (137006 => 137007)


--- trunk/LayoutTests/fast/masking/parsing-mask.html	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/LayoutTests/fast/masking/parsing-mask.html	2012-12-08 02:34:01 UTC (rev 137007)
@@ -66,7 +66,23 @@
 testInner("-webkit-mask", "50px 50%", "50px 50%");
 testInner("-webkit-mask", "center left", "0% 50%");
 testInner("-webkit-mask", "top center", "50% 0%");
+testInner("-webkit-mask", "left 10px top 15px", "left 10px top 15px");
+testInner("-webkit-mask", "left 10% top 30%", "left 10% top 30%");
+testInner("-webkit-mask", "right top 15px", "right 0% top 15px");
+testInner("-webkit-mask", "left 10px center", "left 10px top 50%");
+testInner("-webkit-mask", "center top 20px", "left 50% top 20px");
+testInner("-webkit-mask", "center left 30px", "left 30px top 50%");
+testInner("-webkit-mask", "left 20% top", "left 20% top 0%");
+testInner("-webkit-mask", "center center", "50% 50%");
 
+testInner("-webkit-mask-position", "left 10px top 15px", "left 10px top 15px");
+testInner("-webkit-mask-position", "left 10% top 30%", "left 10% top 30%");
+testInner("-webkit-mask-position", "right top 15px", "right 0% top 15px");
+testInner("-webkit-mask-position", "left 10px center", "left 10px top 50%");
+testInner("-webkit-mask-position", "center top 20px", "left 50% top 20px");
+testInner("-webkit-mask-position", "center left 30px", "left 30px top 50%");
+testInner("-webkit-mask-position", "left 20% top", "left 20% top 0%");
+
 // test mask-repeat
 testInner("-webkit-mask", "repeat-x", "repeat-x");
 testInner("-webkit-mask", "repeat-y", "repeat-y");
@@ -100,16 +116,20 @@
 testInner("-webkit-mask", "none left top / auto 0%", "none 0% 0% / auto 0%");
 testInner("-webkit-mask", "none left top / cover", "none 0% 0% / cover");
 testInner("-webkit-mask", "none left top / contain", "none 0% 0% / contain");
+testInner("-webkit-mask", "none left 20px top 10px / contain", "none left 20px top 10px / contain");
+testInner("-webkit-mask", "none left 20px top / contain", "none left 20px top 0% / contain");
 
 // combinations
 testInner("-webkit-mask", "none padding-box content-box", "none padding-box content-box");
 testInner("-webkit-mask", "none padding-box", "none padding-box padding-box");
 testInner("-webkit-mask", "none top", "none 50% 0%");
+testInner("-webkit-mask", "none center right 20px", "none right 20px top 50%");
 testInner("-webkit-mask", "none border-box left top", "none 0% 0% border-box border-box");
+testInner("-webkit-mask", "none border-box left top 20px", "none left 0% top 20px border-box border-box");
 testInner("-webkit-mask", "none border-box content-box left top repeat-x", "none 0% 0% repeat-x border-box content-box");
 testInner("-webkit-mask", "none border-box content-box left top / auto repeat-x", "none 0% 0% / auto repeat-x border-box content-box");
+testInner("-webkit-mask", "none border-box content-box right 0px center / auto repeat-x", "none right 0px top 50% / auto repeat-x border-box content-box");
 
-
 // FIXME: Computed style not yet implemented.
 // testComputed("-webkit-mask", "", "");
 // https://bugs.webkit.org/show_bug.cgi?id=103021
@@ -136,6 +156,16 @@
 negativeTest("-webkit-mask", "space scroll");
 negativeTest("-webkit-mask", "none scroll");
 negativeTest("-webkit-mask", "none top left / auto repeat-x scroll border-box border-box");
+negativeTest("-webkit-mask", "right top left");
+negativeTest("-webkit-mask", "center left center");
+negativeTest("-webkit-mask", "center top center");
+negativeTest("-webkit-mask", "center right bottom");
+negativeTest("-webkit-mask", "top solid bottom");
+negativeTest("-webkit-mask", "none top left right center top / auto repeat-x scroll border-box border-box");
+negativeTest("-webkit-mask", "none center center 20px / auto repeat-x scroll border-box border-box");
+negativeTest("-webkit-mask", "none top 20px right 30px center / auto repeat-x scroll border-box border-box");
+negativeTest("-webkit-mask", "none top 20px top 30px / auto repeat-x scroll border-box border-box");
+negativeTest("-webkit-mask", "none top 20px bottom / auto repeat-x scroll border-box border-box");
 
 </script>
 <script src=""

Modified: trunk/Source/WebCore/ChangeLog (137006 => 137007)


--- trunk/Source/WebCore/ChangeLog	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/Source/WebCore/ChangeLog	2012-12-08 02:34:01 UTC (rev 137007)
@@ -1,3 +1,37 @@
+2012-12-07  Alexis Menard  <[email protected]>
+
+        Enable CSS3 position offset for CSS Masking.
+        https://bugs.webkit.org/show_bug.cgi?id=104252
+
+        Reviewed by Dirk Schulze.
+
+        To follow CSS3 background-position, mask-position should also support
+        the new <position> type (http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#mask-property).
+        Now the code is shared between background and mask I renamed the
+        functions used to be more generic. Note that the feature flag is not
+        meant to stay and will be removed in a following commit.
+
+        No new tests : I modified LayoutTests/fast/masking/parsing-mask.html to
+        cover the new feature.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::createPositionListForLayer):
+        * css/CSSParser.cpp:
+        (WebCore::isFillPositionKeyword):
+        (WebCore::CSSParser::parse4ValuesFillPosition):
+        (WebCore::CSSParser::parse3ValuesFillPosition):
+        (WebCore::CSSParser::isPotentialPositionValue):
+        (WebCore::CSSParser::parseFillPosition):
+        (WebCore::CSSParser::parse2ValuesFillPosition):
+        (WebCore::CSSParser::parseFillProperty):
+        (WebCore::CSSParser::parseTransformOriginShorthand):
+        (WebCore::CSSParser::parseRadialGradient):
+        (WebCore::CSSParser::parsePerspectiveOrigin):
+        * css/CSSParser.h:
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::mapFillXPosition):
+        (WebCore::CSSToStyleMap::mapFillYPosition):
+
 2012-12-07  No'am Rosenthal  <[email protected]>
 
         Use background color for GraphicsLayers when applicable

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (137006 => 137007)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-12-08 02:34:01 UTC (rev 137007)
@@ -600,12 +600,12 @@
 {
     RefPtr<CSSValueList> positionList = CSSValueList::createSpaceSeparated();
     if (layer->isBackgroundOriginSet()) {
-        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition);
+        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPosition || propertyID == CSSPropertyWebkitMaskPosition);
         positionList->append(cssValuePool().createValue(layer->backgroundXOrigin()));
     }
     positionList->append(zoomAdjustedPixelValueForLength(layer->xPosition(), style));
     if (layer->isBackgroundOriginSet()) {
-        ASSERT(propertyID == CSSPropertyBackgroundPosition);
+        ASSERT(propertyID == CSSPropertyBackgroundPosition || propertyID == CSSPropertyWebkitMaskPosition);
         positionList->append(cssValuePool().createValue(layer->backgroundYOrigin()));
     }
     positionList->append(zoomAdjustedPixelValueForLength(layer->yPosition(), style));

Modified: trunk/Source/WebCore/css/CSSParser.cpp (137006 => 137007)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-12-08 02:34:01 UTC (rev 137007)
@@ -3729,16 +3729,16 @@
     return false;
 }
 
-static bool isBackgroundPositionKeyword(int value)
+static bool isFillPositionKeyword(int value)
 {
     return value == CSSValueLeft || value == CSSValueTop || value == CSSValueBottom || value == CSSValueRight || value == CSSValueCenter;
 }
 
-void CSSParser::parse4ValuesBackgroundPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsedValue1, PassRefPtr<CSSPrimitiveValue> parsedValue2)
+void CSSParser::parse4ValuesFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsedValue1, PassRefPtr<CSSPrimitiveValue> parsedValue2)
 {
     // [ left | right ] [ <percentage] | <length> ] && [ top | bottom ] [ <percentage> | <length> ]
     // In the case of 4 values <position> requires the second value to be a length or a percentage.
-    if (isBackgroundPositionKeyword(parsedValue2->getIdent()))
+    if (isFillPositionKeyword(parsedValue2->getIdent()))
         return;
 
     unsigned cumulativeFlags = 0;
@@ -3753,7 +3753,7 @@
     if (ident1 == CSSValueCenter)
         return;
 
-    if (!isBackgroundPositionKeyword(ident3) || ident3 == CSSValueCenter)
+    if (!isFillPositionKeyword(ident3) || ident3 == CSSValueCenter)
         return;
 
     // We need to check if the values are not conflicting, e.g. they are not on the same edge. It is
@@ -3771,7 +3771,7 @@
         return;
 
     // 4th value must be a length or a percentage.
-    if (isBackgroundPositionKeyword(value4->getIdent()))
+    if (isFillPositionKeyword(value4->getIdent()))
         return;
 
     value1 = createPrimitiveValuePair(parsedValue1, parsedValue2);
@@ -3782,7 +3782,7 @@
 
     valueList->next();
 }
-void CSSParser::parse3ValuesBackgroundPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsedValue1, PassRefPtr<CSSPrimitiveValue> parsedValue2)
+void CSSParser::parse3ValuesFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, PassRefPtr<CSSPrimitiveValue> parsedValue1, PassRefPtr<CSSPrimitiveValue> parsedValue2)
 {
     unsigned cumulativeFlags = 0;
     FillPositionFlag value3Flag = InvalidFillPosition;
@@ -3804,11 +3804,11 @@
 
     if (ident1 == CSSValueCenter) {
         // <position> requires the first 'center' to be followed by a keyword.
-        if (!isBackgroundPositionKeyword(ident2))
+        if (!isFillPositionKeyword(ident2))
             return;
 
         // If 'center' is the first keyword then the last one needs to be a length.
-        if (isBackgroundPositionKeyword(ident3))
+        if (isFillPositionKeyword(ident3))
             return;
 
         firstPositionKeyword = CSSValueLeft;
@@ -3819,7 +3819,7 @@
         value1 = createPrimitiveValuePair(cssValuePool().createIdentifierValue(firstPositionKeyword), cssValuePool().createValue(50, CSSPrimitiveValue::CSS_PERCENTAGE));
         value2 = createPrimitiveValuePair(parsedValue2, value3);
     } else if (ident3 == CSSValueCenter) {
-        if (isBackgroundPositionKeyword(ident2))
+        if (isFillPositionKeyword(ident2))
             return;
 
         secondPositionKeyword = CSSValueTop;
@@ -3833,11 +3833,11 @@
         RefPtr<CSSPrimitiveValue> firstPositionValue;
         RefPtr<CSSPrimitiveValue> secondPositionValue;
 
-        if (isBackgroundPositionKeyword(ident2)) {
+        if (isFillPositionKeyword(ident2)) {
             // To match CSS grammar, we should only accept: [ center | left | right | bottom | top ] [ left | right | top | bottom ] [ <percentage> | <length> ].
             ASSERT(ident2 != CSSValueCenter);
 
-            if (isBackgroundPositionKeyword(ident3))
+            if (isFillPositionKeyword(ident3))
                 return;
 
             secondPositionValue = value3;
@@ -3845,7 +3845,7 @@
             firstPositionValue = cssValuePool().createValue(0, CSSPrimitiveValue::CSS_PERCENTAGE);
         } else {
             // Per CSS, we should only accept: [ right | left | top | bottom ] [ <percentage> | <length> ] [ center | left | right | bottom | top ].
-            if (!isBackgroundPositionKeyword(ident3))
+            if (!isFillPositionKeyword(ident3))
                 return;
 
             firstPositionValue = parsedValue2;
@@ -3875,10 +3875,10 @@
 
 inline bool CSSParser::isPotentialPositionValue(CSSParserValue* value)
 {
-    return isBackgroundPositionKeyword(value->id) || validUnit(value, FPercent | FLength, ReleaseParsedCalcValue);
+    return isFillPositionKeyword(value->id) || validUnit(value, FPercent | FLength, ReleaseParsedCalcValue);
 }
 
-void CSSParser::parseFillBackgroundPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2)
+void CSSParser::parseFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2)
 {
     unsigned numberOfValues = 0;
     for (unsigned i = valueList->currentIndex(); i < valueList->size(); ++i, ++numberOfValues) {
@@ -3892,7 +3892,7 @@
 
     // If we are parsing two values, we can safely call the CSS 2.1 parsing function and return.
     if (numberOfValues <= 2) {
-        parseFillPosition(valueList, value1, value2);
+        parse2ValuesFillPosition(valueList, value1, value2);
         return;
     }
 
@@ -3901,7 +3901,7 @@
     CSSParserValue* value = valueList->current();
 
     // <position> requires the first value to be a background keyword.
-    if (!isBackgroundPositionKeyword(value->id))
+    if (!isFillPositionKeyword(value->id))
         return;
 
     // Parse the first value. We're just making sure that it is one of the valid keywords or a percentage/length.
@@ -3936,13 +3936,13 @@
         return;
 
     if (numberOfValues == 3)
-        parse3ValuesBackgroundPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release());
+        parse3ValuesFillPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release());
     else
-        parse4ValuesBackgroundPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release());
+        parse4ValuesFillPosition(valueList, value1, value2, parsedValue1.release(), parsedValue2.release());
 }
 #endif
 
-void CSSParser::parseFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2)
+void CSSParser::parse2ValuesFillPosition(CSSParserValueList* valueList, RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2)
 {
     CSSParserValue* value = valueList->current();
 
@@ -4151,15 +4151,15 @@
                     }
                     break;
                 case CSSPropertyBackgroundPosition:
+                case CSSPropertyWebkitMaskPosition:
 #if ENABLE(CSS3_BACKGROUND)
-                    parseFillBackgroundPosition(m_valueList.get(), currValue, currValue2);
-                    // parseFillBackgroundPosition advances the m_valueList pointer.
+                    parseFillPosition(m_valueList.get(), currValue, currValue2);
+                    // parseFillPosition advances the m_valueList pointer.
                     break;
                     // Fall through to CSS 2.1 parsing.
 #endif
-                case CSSPropertyWebkitMaskPosition:
-                    parseFillPosition(m_valueList.get(), currValue, currValue2);
-                    // parseFillPosition advances the m_valueList pointer.
+                    parse2ValuesFillPosition(m_valueList.get(), currValue, currValue2);
+                    // parse2ValuesFillPosition advances the m_valueList pointer.
                     break;
                 case CSSPropertyBackgroundPositionX:
                 case CSSPropertyWebkitMaskPositionX: {
@@ -4323,7 +4323,7 @@
 
 bool CSSParser::parseTransformOriginShorthand(RefPtr<CSSValue>& value1, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
 {
-    parseFillPosition(m_valueList.get(), value1, value2);
+    parse2ValuesFillPosition(m_valueList.get(), value1, value2);
 
     // now get z
     if (m_valueList->current()) {
@@ -7212,8 +7212,8 @@
     // Optional background-position
     RefPtr<CSSValue> centerX;
     RefPtr<CSSValue> centerY;
-    // parseFillPosition advances the args next pointer.
-    parseFillPosition(args, centerX, centerY);
+    // parse2ValuesFillPosition advances the args next pointer.
+    parse2ValuesFillPosition(args, centerX, centerY);
     a = args->current();
     if (!a)
         return false;
@@ -8528,7 +8528,7 @@
         case CSSPropertyWebkitPerspectiveOrigin:
             if (m_valueList->size() > 2)
                 return false;
-            parseFillPosition(m_valueList.get(), value, value2);
+            parse2ValuesFillPosition(m_valueList.get(), value, value2);
             break;
         case CSSPropertyWebkitPerspectiveOriginX: {
             value = parseFillPositionX(m_valueList.get());

Modified: trunk/Source/WebCore/css/CSSParser.h (137006 => 137007)


--- trunk/Source/WebCore/css/CSSParser.h	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/Source/WebCore/css/CSSParser.h	2012-12-08 02:34:01 UTC (rev 137007)
@@ -117,12 +117,12 @@
     PassRefPtr<CSSPrimitiveValue> parseFillPositionComponent(CSSParserValueList*, unsigned& cumulativeFlags, FillPositionFlag& individualFlag, FillPositionParsingMode = ResolveValuesAsPercent);
     PassRefPtr<CSSValue> parseFillPositionX(CSSParserValueList*);
     PassRefPtr<CSSValue> parseFillPositionY(CSSParserValueList*);
-    void parseFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
+    void parse2ValuesFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
 #if ENABLE(CSS3_BACKGROUND)
     bool isPotentialPositionValue(CSSParserValue*);
-    void parseFillBackgroundPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
-    void parse3ValuesBackgroundPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>);
-    void parse4ValuesBackgroundPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>);
+    void parseFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
+    void parse3ValuesFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>);
+    void parse4ValuesFillPosition(CSSParserValueList*, RefPtr<CSSValue>&, RefPtr<CSSValue>&, PassRefPtr<CSSPrimitiveValue>, PassRefPtr<CSSPrimitiveValue>);
 #endif
 
     void parseFillRepeat(RefPtr<CSSValue>&, RefPtr<CSSValue>&);

Modified: trunk/Source/WebCore/css/CSSToStyleMap.cpp (137006 => 137007)


--- trunk/Source/WebCore/css/CSSToStyleMap.cpp	2012-12-08 02:29:36 UTC (rev 137006)
+++ trunk/Source/WebCore/css/CSSToStyleMap.cpp	2012-12-08 02:34:01 UTC (rev 137007)
@@ -229,7 +229,7 @@
 #if ENABLE(CSS3_BACKGROUND)
     Pair* pair = primitiveValue->getPairValue();
     if (pair) {
-        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX);
+        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionX || propertyID == CSSPropertyWebkitMaskPositionX);
         primitiveValue = pair->second();
     }
 #else
@@ -269,7 +269,7 @@
 #if ENABLE(CSS3_BACKGROUND)
     Pair* pair = primitiveValue->getPairValue();
     if (pair) {
-        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY);
+        ASSERT_UNUSED(propertyID, propertyID == CSSPropertyBackgroundPositionY || propertyID == CSSPropertyWebkitMaskPositionY);
         primitiveValue = pair->second();
     }
 #else
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to