Title: [102029] branches/safari-534.53-branch

Diff

Modified: branches/safari-534.53-branch/LayoutTests/ChangeLog (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/ChangeLog	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/ChangeLog	2011-12-05 20:37:21 UTC (rev 102029)
@@ -1,3 +1,29 @@
+2011-12-05  Lucas Forschler  <[email protected]>
+
+    Merge 94597
+
+    2011-09-06  David Hyatt  <[email protected]>
+
+            https://bugs.webkit.org/show_bug.cgi?id=67672
+
+            Improve background-size parsing. Make it actually dump auto values properly, and also make it omit
+            auto if it is the second value. Fix the parsing to not create a value list when only a singleton value
+            is specified.
+
+            Reviewed by Beth Dakin.
+
+            Covered well by existing tests.
+
+            * fast/backgrounds/size/parsing-background-size-values-expected.txt:
+            * fast/backgrounds/size/parsing-inherit-expected.txt:
+            * fast/backgrounds/size/resources/parsing-background-size-values.js:
+            * fast/backgrounds/size/resources/parsing-inherit.js:
+            * fast/css/getComputedStyle/computed-style-expected.txt:
+            * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+            * fast/css/getComputedStyle/getComputedStyle-background-size-expected.txt:
+            * fast/css/value-list-out-of-bounds-crash.html:
+            * svg/css/getComputedStyle-basic-expected.txt:
+
 2011-11-30  Lucas Forschler  <[email protected]>
 
     Merge 94595

Modified: branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt	2011-12-05 20:37:21 UTC (rev 102029)
@@ -7,19 +7,19 @@
 PASS test("background-size: cover;") is "cover"
 PASS test("background-size: 100 100;") is "100px"
 PASS test("background-size: 100px 100px;") is "100px"
-PASS test("background-size: auto 50px;") is " 50px"
-PASS test("background-size: 50px auto;") is "50px "
-PASS test("background-size: auto auto;") is " "
+PASS test("background-size: auto 50px;") is "auto 50px"
+PASS test("background-size: 50px auto;") is "50px"
+PASS test("background-size: auto auto;") is "auto"
 PASS test("background-size: 30% 20%;") is "30% 20%"
-PASS test("background-size: 4em auto;") is "4em "
-PASS test("background-size: 5em;") is "5em "
+PASS test("background-size: 4em auto;") is "4em"
+PASS test("background-size: 5em;") is "5em"
 PASS test("-webkit-background-size: 5em ;") is "5em"
 PASS test("background-size: 100 100 100;") is null
 PASS test("background-size: coconut;") is null
 PASS test("background-size: 100px,;") is null
-PASS test("background-size: 100px, 50%;") is "100px , 50% "
+PASS test("background-size: 100px, 50%;") is "100px, 50%"
 PASS test("-webkit-background-size: 100px, 50%;") is "100px, 50%"
-PASS test("background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em , 100px 50%"
+PASS test("background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em, 100px 50%"
 PASS test("-webkit-background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em, 100px 50%"
 PASS successfullyParsed is true
 

Modified: branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt	2011-12-05 20:37:21 UTC (rev 102029)
@@ -8,14 +8,14 @@
 PASS test("background-size: 100 100;") is "100px 100px"
 PASS test("background-size: 100px 100px;") is "100px 100px"
 PASS test("background-size: auto 50px;") is "auto 50px"
-PASS test("background-size: 50px auto;") is "50px auto"
-PASS test("background-size: auto auto;") is "auto auto"
+PASS test("background-size: 50px auto;") is "50px"
+PASS test("background-size: auto auto;") is "auto"
 PASS test("background-size: 30% 20%;") is "30% 20%"
-PASS test("background-size: 4em auto;") is "64px auto"
-PASS test("background-size: 5em ;") is "80px auto"
+PASS test("background-size: 4em auto;") is "64px"
+PASS test("background-size: 5em ;") is "80px"
 PASS test("-webkit-background-size: 5em ;") is "80px 80px"
-PASS test("background-size: 100 100 100;") is "auto auto"
-PASS test("background-size: coconut;") is "auto auto"
+PASS test("background-size: 100 100 100;") is "auto"
+PASS test("background-size: coconut;") is "auto"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js	2011-12-05 20:37:21 UTC (rev 102029)
@@ -15,21 +15,21 @@
 shouldBe('test("background-size: cover;")', '"cover"');
 shouldBe('test("background-size: 100 100;")', '"100px"');
 shouldBe('test("background-size: 100px 100px;")', '"100px"');
-shouldBe('test("background-size: auto 50px;")', '" 50px"');
-shouldBe('test("background-size: 50px auto;")', '"50px "');
-shouldBe('test("background-size: auto auto;")', '" "');
+shouldBe('test("background-size: auto 50px;")', '"auto 50px"');
+shouldBe('test("background-size: 50px auto;")', '"50px"');
+shouldBe('test("background-size: auto auto;")', '"auto"');
 shouldBe('test("background-size: 30% 20%;")', '"30% 20%"');
-shouldBe('test("background-size: 4em auto;")', '"4em "');
-shouldBe('test("background-size: 5em;")', '"5em "');
+shouldBe('test("background-size: 4em auto;")', '"4em"');
+shouldBe('test("background-size: 5em;")', '"5em"');
 shouldBe('test("-webkit-background-size: 5em ;")', '"5em"');
 
 shouldBe('test("background-size: 100 100 100;")', 'null');
 shouldBe('test("background-size: coconut;")', 'null');
 
 shouldBe('test("background-size: 100px,;")', 'null');
-shouldBe('test("background-size: 100px, 50%;")', '"100px , 50% "');
+shouldBe('test("background-size: 100px, 50%;")', '"100px, 50%"');
 shouldBe('test("-webkit-background-size: 100px, 50%;")', '"100px, 50%"');
-shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em , 100px 50%"');
+shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em, 100px 50%"');
 shouldBe('test("-webkit-background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em, 100px 50%"');
 
 var successfullyParsed = true;

Modified: branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js	2011-12-05 20:37:21 UTC (rev 102029)
@@ -20,14 +20,14 @@
 shouldBe('test("background-size: 100 100;")', '"100px 100px"');
 shouldBe('test("background-size: 100px 100px;")', '"100px 100px"');
 shouldBe('test("background-size: auto 50px;")', '"auto 50px"');
-shouldBe('test("background-size: 50px auto;")', '"50px auto"');
-shouldBe('test("background-size: auto auto;")', '"auto auto"');
+shouldBe('test("background-size: 50px auto;")', '"50px"');
+shouldBe('test("background-size: auto auto;")', '"auto"');
 shouldBe('test("background-size: 30% 20%;")', '"30% 20%"');
-shouldBe('test("background-size: 4em auto;")', '"64px auto"');
-shouldBe('test("background-size: 5em ;")', '"80px auto"');
+shouldBe('test("background-size: 4em auto;")', '"64px"');
+shouldBe('test("background-size: 5em ;")', '"80px"');
 shouldBe('test("-webkit-background-size: 5em ;")', '"80px 80px"');
 
-shouldBe('test("background-size: 100 100 100;")', '"auto auto"');
-shouldBe('test("background-size: coconut;")', '"auto auto"');
+shouldBe('test("background-size: 100 100 100;")', '"auto"');
+shouldBe('test("background-size: coconut;")', '"auto"');
 
 var successfullyParsed = true;

Modified: branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt	2011-12-05 20:37:21 UTC (rev 102029)
@@ -7,7 +7,7 @@
 background-origin: padding-box;
 background-position: 0% 0%;
 background-repeat: repeat;
-background-size: auto auto;
+background-size: auto;
 border-bottom-color: rgb(0, 0, 0);
 border-bottom-left-radius: 0px;
 border-bottom-right-radius: 0px;
@@ -113,7 +113,7 @@
 -webkit-background-clip: border-box;
 -webkit-background-composite: source-over;
 -webkit-background-origin: padding-box;
--webkit-background-size: auto auto;
+-webkit-background-size: auto;
 -webkit-border-fit: border;
 -webkit-border-horizontal-spacing: 0px;
 -webkit-border-image: none;
@@ -167,7 +167,7 @@
 -webkit-mask-origin: border-box;
 -webkit-mask-position: 0% 0%;
 -webkit-mask-repeat: repeat;
--webkit-mask-size: auto auto;
+-webkit-mask-size: auto;
 -webkit-nbsp-mode: normal;
 -webkit-perspective: none;
 -webkit-perspective-origin: 392px 288px;

Modified: branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-12-05 20:37:21 UTC (rev 102029)
@@ -6,7 +6,7 @@
     background-origin: padding-box
     background-position: 0% 0%
     background-repeat: repeat
-    background-size: auto auto
+    background-size: auto
     border-bottom-color: rgb(0, 0, 0)
     border-bottom-left-radius: 0px
     border-bottom-right-radius: 0px
@@ -112,7 +112,7 @@
     -webkit-background-clip: border-box
     -webkit-background-composite: source-over
     -webkit-background-origin: padding-box
-    -webkit-background-size: auto auto
+    -webkit-background-size: auto
     -webkit-border-fit: border
     -webkit-border-horizontal-spacing: 0px
     -webkit-border-image: none
@@ -160,7 +160,7 @@
     -webkit-mask-origin: border-box
     -webkit-mask-position: 0% 0%
     -webkit-mask-repeat: repeat
-    -webkit-mask-size: auto auto
+    -webkit-mask-size: auto
     -webkit-nbsp-mode: normal
     -webkit-perspective: none
     -webkit-perspective-origin: 50% 50%

Modified: branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-size-expected.txt (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-size-expected.txt	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-size-expected.txt	2011-12-05 20:37:21 UTC (rev 102029)
@@ -12,6 +12,6 @@
 getPropertyCSSValue(-webkit-background-size): [object CSSValueList]
 
 Test getting initial value of the background size.
-getPropertyValue(-webkit-background-size): auto auto
-getPropertyCSSValue(-webkit-background-size): [object CSSValueList]
+getPropertyValue(-webkit-background-size): auto
+getPropertyCSSValue(-webkit-background-size): [object CSSPrimitiveValue]
 

Modified: branches/safari-534.53-branch/LayoutTests/fast/css/value-list-out-of-bounds-crash.html (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/fast/css/value-list-out-of-bounds-crash.html	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/fast/css/value-list-out-of-bounds-crash.html	2011-12-05 20:37:21 UTC (rev 102029)
@@ -4,7 +4,7 @@
         width: 200px;
         height: 200px;
         background-image:url(resources/bikes.bmp); 
-        -webkit-background-size: 50% auto;
+        -webkit-background-size: 50% 100%;
     }
 </style>
 </head>

Modified: branches/safari-534.53-branch/LayoutTests/svg/css/getComputedStyle-basic-expected.txt (102028 => 102029)


--- branches/safari-534.53-branch/LayoutTests/svg/css/getComputedStyle-basic-expected.txt	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/LayoutTests/svg/css/getComputedStyle-basic-expected.txt	2011-12-05 20:37:21 UTC (rev 102029)
@@ -12,8 +12,8 @@
 rect: style.getPropertyCSSValue(background-position) : [object CSSValueList]
 rect: style.getPropertyValue(background-repeat) : repeat
 rect: style.getPropertyCSSValue(background-repeat) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(background-size) : auto auto
-rect: style.getPropertyCSSValue(background-size) : [object CSSValueList]
+rect: style.getPropertyValue(background-size) : auto
+rect: style.getPropertyCSSValue(background-size) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(border-bottom-color) : rgb(0, 0, 0)
 rect: style.getPropertyCSSValue(border-bottom-color) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(border-bottom-left-radius) : 0px
@@ -224,8 +224,8 @@
 rect: style.getPropertyCSSValue(-webkit-background-composite) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-background-origin) : padding-box
 rect: style.getPropertyCSSValue(-webkit-background-origin) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(-webkit-background-size) : auto auto
-rect: style.getPropertyCSSValue(-webkit-background-size) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-background-size) : auto
+rect: style.getPropertyCSSValue(-webkit-background-size) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-border-fit) : border
 rect: style.getPropertyCSSValue(-webkit-border-fit) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-border-horizontal-spacing) : 0px
@@ -332,8 +332,8 @@
 rect: style.getPropertyCSSValue(-webkit-mask-position) : [object CSSValueList]
 rect: style.getPropertyValue(-webkit-mask-repeat) : repeat
 rect: style.getPropertyCSSValue(-webkit-mask-repeat) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(-webkit-mask-size) : auto auto
-rect: style.getPropertyCSSValue(-webkit-mask-size) : [object CSSValueList]
+rect: style.getPropertyValue(-webkit-mask-size) : auto
+rect: style.getPropertyCSSValue(-webkit-mask-size) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-nbsp-mode) : normal
 rect: style.getPropertyCSSValue(-webkit-nbsp-mode) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-perspective) : none
@@ -474,8 +474,8 @@
 g: style.getPropertyCSSValue(background-position) : [object CSSValueList]
 g: style.getPropertyValue(background-repeat) : repeat
 g: style.getPropertyCSSValue(background-repeat) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(background-size) : auto auto
-g: style.getPropertyCSSValue(background-size) : [object CSSValueList]
+g: style.getPropertyValue(background-size) : auto
+g: style.getPropertyCSSValue(background-size) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(border-bottom-color) : rgb(0, 0, 0)
 g: style.getPropertyCSSValue(border-bottom-color) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(border-bottom-left-radius) : 0px
@@ -686,8 +686,8 @@
 g: style.getPropertyCSSValue(-webkit-background-composite) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-background-origin) : padding-box
 g: style.getPropertyCSSValue(-webkit-background-origin) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(-webkit-background-size) : auto auto
-g: style.getPropertyCSSValue(-webkit-background-size) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-background-size) : auto
+g: style.getPropertyCSSValue(-webkit-background-size) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-border-fit) : border
 g: style.getPropertyCSSValue(-webkit-border-fit) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-border-horizontal-spacing) : 0px
@@ -794,8 +794,8 @@
 g: style.getPropertyCSSValue(-webkit-mask-position) : [object CSSValueList]
 g: style.getPropertyValue(-webkit-mask-repeat) : repeat
 g: style.getPropertyCSSValue(-webkit-mask-repeat) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(-webkit-mask-size) : auto auto
-g: style.getPropertyCSSValue(-webkit-mask-size) : [object CSSValueList]
+g: style.getPropertyValue(-webkit-mask-size) : auto
+g: style.getPropertyCSSValue(-webkit-mask-size) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-nbsp-mode) : normal
 g: style.getPropertyCSSValue(-webkit-nbsp-mode) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-perspective) : none

Modified: branches/safari-534.53-branch/Source/WebCore/ChangeLog (102028 => 102029)


--- branches/safari-534.53-branch/Source/WebCore/ChangeLog	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/Source/WebCore/ChangeLog	2011-12-05 20:37:21 UTC (rev 102029)
@@ -1,5 +1,28 @@
 2011-12-05  Lucas Forschler  <[email protected]>
 
+    Merge 94597
+
+    2011-09-06  David Hyatt  <[email protected]>
+
+            https://bugs.webkit.org/show_bug.cgi?id=67672
+
+            Improve background-size parsing. Make it actually dump auto values properly, and also make it omit
+            auto if it is the second value. Fix the parsing to not create a value list when only a singleton value
+            is specified.
+
+            Reviewed by Beth Dakin.
+
+            Covered well by existing tests.
+
+            * css/CSSComputedStyleDeclaration.cpp:
+            (WebCore::fillSizeToCSSValue):
+            * css/CSSParser.cpp:
+            (WebCore::CSSParser::parseFillSize):
+            * css/CSSStyleSelector.cpp:
+            (WebCore::CSSStyleSelector::mapFillSize):
+
+2011-12-05  Lucas Forschler  <[email protected]>
+
         Fixes to the branch made by Simon to get us building again.
         
         * css/CSSStyleSelector.cpp:

Modified: branches/safari-534.53-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (102028 => 102029)


--- branches/safari-534.53-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2011-12-05 20:37:21 UTC (rev 102029)
@@ -852,6 +852,9 @@
     if (fillSize.type == Cover)
         return primitiveValueCache->createIdentifierValue(CSSValueCover);
 
+    if (fillSize.size.height().isAuto())
+        return primitiveValueCache->createValue(fillSize.size.width());
+
     RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
     list->append(primitiveValueCache->createValue(fillSize.size.width()));
     list->append(primitiveValueCache->createValue(fillSize.size.height()));

Modified: branches/safari-534.53-branch/Source/WebCore/css/CSSParser.cpp (102028 => 102029)


--- branches/safari-534.53-branch/Source/WebCore/css/CSSParser.cpp	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/Source/WebCore/css/CSSParser.cpp	2011-12-05 20:37:21 UTC (rev 102029)
@@ -2894,7 +2894,7 @@
     RefPtr<CSSPrimitiveValue> parsedValue1;
 
     if (value->id == CSSValueAuto)
-        parsedValue1 = primitiveValueCache()->createValue(0, CSSPrimitiveValue::CSS_UNKNOWN);
+        parsedValue1 = primitiveValueCache()->createIdentifierValue(CSSValueAuto);
     else {
         if (!validUnit(value, FLength | FPercent, m_strict))
             return 0;
@@ -2904,23 +2904,22 @@
     CSSPropertyID property = static_cast<CSSPropertyID>(propId);
     RefPtr<CSSPrimitiveValue> parsedValue2;
     if ((value = m_valueList->next())) {
-        if (value->id == CSSValueAuto)
-            parsedValue2 = primitiveValueCache()->createValue(0, CSSPrimitiveValue::CSS_UNKNOWN);
-        else if (value->unit == CSSParserValue::Operator && value->iValue == ',')
+        if (value->unit == CSSParserValue::Operator && value->iValue == ',')
             allowComma = false;
-        else {
+        else if (value->id != CSSValueAuto) {
             if (!validUnit(value, FLength | FPercent, m_strict))
                 return 0;
             parsedValue2 = primitiveValueCache()->createValue(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
         }
+    } else if (!parsedValue2 && property == CSSPropertyWebkitBackgroundSize) {
+        // For backwards compatibility we set the second value to the first if it is omitted.
+        // We only need to do this for -webkit-background-size. It should be safe to let masks match
+        // the real property.
+        parsedValue2 = parsedValue1;
     }
-    if (!parsedValue2) {
-        if (property == CSSPropertyWebkitBackgroundSize || property == CSSPropertyWebkitMaskSize)
-            parsedValue2 = parsedValue1;
-        else
-            parsedValue2 = primitiveValueCache()->createValue(0, CSSPrimitiveValue::CSS_UNKNOWN);
-    }
 
+    if (!parsedValue2)
+        return parsedValue1;
     return primitiveValueCache()->createValue(Pair::create(parsedValue1.release(), parsedValue2.release()));
 }
 

Modified: branches/safari-534.53-branch/Source/WebCore/css/CSSStyleSelector.cpp (102028 => 102029)


--- branches/safari-534.53-branch/Source/WebCore/css/CSSStyleSelector.cpp	2011-12-05 20:27:47 UTC (rev 102028)
+++ branches/safari-534.53-branch/Source/WebCore/css/CSSStyleSelector.cpp	2011-12-05 20:37:21 UTC (rev 102029)
@@ -5913,20 +5913,18 @@
     }
 
     Pair* pair = primitiveValue->getPairValue();
-    if (!pair || !pair->first() || !pair->second())
-        return;
+
+    CSSPrimitiveValue* first = pair ? static_cast<CSSPrimitiveValue*>(pair->first()) : primitiveValue;
+    CSSPrimitiveValue* second = pair ? static_cast<CSSPrimitiveValue*>(pair->second()) : 0;
     
-    CSSPrimitiveValue* first = static_cast<CSSPrimitiveValue*>(pair->first());
-    CSSPrimitiveValue* second = static_cast<CSSPrimitiveValue*>(pair->second());
-    
     Length firstLength, secondLength;
     int firstType = first->primitiveType();
-    int secondType = second->primitiveType();
-    
+    int secondType = second ? second->primitiveType() : 0;
+
     float zoomFactor = m_style->effectiveZoom();
 
-    if (firstType == CSSPrimitiveValue::CSS_UNKNOWN)
-        firstLength = Length(Auto);
+    if (first->getIdent() == CSSValueAuto)
+        firstLength = Length();
     else if (CSSPrimitiveValue::isUnitTypeLength(firstType))
         firstLength = Length(first->computeLengthIntForLength(style(), m_rootElementStyle, zoomFactor), Fixed);
     else if (firstType == CSSPrimitiveValue::CSS_PERCENTAGE)
@@ -5934,8 +5932,8 @@
     else
         return;
 
-    if (secondType == CSSPrimitiveValue::CSS_UNKNOWN)
-        secondLength = Length(Auto);
+    if (!second || second->getIdent() == CSSValueAuto)
+        secondLength = Length();
     else if (CSSPrimitiveValue::isUnitTypeLength(secondType))
         secondLength = Length(second->computeLengthIntForLength(style(), m_rootElementStyle, zoomFactor), Fixed);
     else if (secondType == CSSPrimitiveValue::CSS_PERCENTAGE)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to