REGRESSION (r109964): Assertion failure (!isUndefined()) in Length::getIntValue(...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2012 19:18:44 +0000 (19:18 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2012 19:18:44 +0000 (19:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80614

Reviewed by Beth Dakin.

Source/WebCore:

Test: fast/css/dashboard-regions-undefined-length-assertion.html

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList): Reverted to setting zero lengths,
rather than Undefined ones, in the RenderStyle when offsets are not given.

LayoutTests:

* fast/css/dashboard-regions-undefined-length-assertion-expected.txt: Added.
* fast/css/dashboard-regions-undefined-length-assertion.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/dashboard-regions-undefined-length-assertion-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/dashboard-regions-undefined-length-assertion.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleSelector.cpp

index 41671edb281d841e38a5e5310db71a6c304ebe4c..31d461404d1b6bfaaa9e9995625f198d2b5498da 100644 (file)
@@ -1,3 +1,13 @@
+2012-03-08  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r109964): Assertion failure (!isUndefined()) in Length::getIntValue() when a Dashboard region is specified without offsets
+        https://bugs.webkit.org/show_bug.cgi?id=80614
+
+        Reviewed by Beth Dakin.
+
+        * fast/css/dashboard-regions-undefined-length-assertion-expected.txt: Added.
+        * fast/css/dashboard-regions-undefined-length-assertion.html: Added.
+
 2012-03-08  Stephen White  <senorblanco@chromium.org>
 
         [chromium] Unreviewed gardening.
diff --git a/LayoutTests/fast/css/dashboard-regions-undefined-length-assertion-expected.txt b/LayoutTests/fast/css/dashboard-regions-undefined-length-assertion-expected.txt
new file mode 100644 (file)
index 0000000..9a151d8
--- /dev/null
@@ -0,0 +1 @@
+The test passes if it does not cause an assertion failure.
diff --git a/LayoutTests/fast/css/dashboard-regions-undefined-length-assertion.html b/LayoutTests/fast/css/dashboard-regions-undefined-length-assertion.html
new file mode 100644 (file)
index 0000000..aac5f39
--- /dev/null
@@ -0,0 +1,6 @@
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<div style="-webkit-dashboard-region: dashboard-region(control rectangle)"></div>
+<p>The test passes if it does not cause an assertion failure.</p>
index 576a1f9e6474c1d9e0b214216b795b35508707cd..b0dde7dcfb31cd3228036745100ed331aaf225f6 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-08  Dan Bernstein  <mitz@apple.com>
+
+        REGRESSION (r109964): Assertion failure (!isUndefined()) in Length::getIntValue() when a Dashboard region is specified without offsets
+        https://bugs.webkit.org/show_bug.cgi?id=80614
+
+        Reviewed by Beth Dakin.
+
+        Test: fast/css/dashboard-regions-undefined-length-assertion.html
+
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::collectMatchingRulesForList): Reverted to setting zero lengths,
+        rather than Undefined ones, in the RenderStyle when offsets are not given.
+
 2012-03-08  Mikkel Kruse Johnsen  <mikkel@linet.dk>
 
         WebKitGtk+ fails to build on win32 against GTK3
index 0307b95d6bfc1b8911b12c25fe5f5529985b0612..59f615a6a957c32d4823956d2b48d200818d932c 100644 (file)
@@ -3543,6 +3543,16 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
             Length right = convertToIntLength(region->right(), style(), m_rootElementStyle);
             Length bottom = convertToIntLength(region->bottom(), style(), m_rootElementStyle);
             Length left = convertToIntLength(region->left(), style(), m_rootElementStyle);
+
+            if (top.isUndefined())
+                top = Length();
+            if (right.isUndefined())
+                right = Length();
+            if (bottom.isUndefined())
+                bottom = Length();
+            if (left.isUndefined())
+                left = Length();
+
             if (region->m_isCircle)
                 m_style->setDashboardRegion(StyleDashboardRegion::Circle, region->m_label, top, right, bottom, left, region == first ? false : true);
             else if (region->m_isRectangle)