Title: [153981] trunk
Revision
153981
Author
[email protected]
Date
2013-08-12 23:26:45 -0700 (Mon, 12 Aug 2013)

Log Message

ASSERTION FAILED: type() == Percent in WebCore::Length::percent
https://bugs.webkit.org/show_bug.cgi?id=116715

Reviewed by Darin Adler.

Source/WebCore: 

Allow the Calculated type in the Length::percent method that returns the Length's
float value. This reflects the changes in r110148 that adjusted the Length::isPercent
method to return true for Length objects of either Percent or Calculated type.

Test: fast/css/calculated-length-as-percent-crash.html

* platform/Length.h:
(WebCore::Length::percent): Assert that Length::isPercent is true when Length::percent
is called, ensuring the Length's type is either Percent or Calculated.

LayoutTests: 

Add the test case, as produced by the Fuzzinator, that was causing assertions
in Length::percent due to Length objects of the Calculated type not being treated
as holding a proper percent value in that method, despite Length::isPercent
returning true for Length objects of either Percent or the Calculated type.

* fast/css/calculated-length-as-percent-crash-expected.txt: Added.
* fast/css/calculated-length-as-percent-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (153980 => 153981)


--- trunk/LayoutTests/ChangeLog	2013-08-13 06:26:29 UTC (rev 153980)
+++ trunk/LayoutTests/ChangeLog	2013-08-13 06:26:45 UTC (rev 153981)
@@ -1,3 +1,18 @@
+2013-08-12  Zan Dobersek  <[email protected]>
+
+        ASSERTION FAILED: type() == Percent in WebCore::Length::percent
+        https://bugs.webkit.org/show_bug.cgi?id=116715
+
+        Reviewed by Darin Adler.
+
+        Add the test case, as produced by the Fuzzinator, that was causing assertions
+        in Length::percent due to Length objects of the Calculated type not being treated
+        as holding a proper percent value in that method, despite Length::isPercent
+        returning true for Length objects of either Percent or the Calculated type.
+
+        * fast/css/calculated-length-as-percent-crash-expected.txt: Added.
+        * fast/css/calculated-length-as-percent-crash.html: Added.
+
 2013-08-12  Alexey Proskuryakov  <[email protected]>
 
         http/tests/security/sandboxed-iframe-invalid.html is flaky on Mac

Added: trunk/LayoutTests/fast/css/calculated-length-as-percent-crash-expected.txt (0 => 153981)


--- trunk/LayoutTests/fast/css/calculated-length-as-percent-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/calculated-length-as-percent-crash-expected.txt	2013-08-13 06:26:45 UTC (rev 153981)
@@ -0,0 +1,3 @@
+Test for bug #116715: ASSERTION FAILED: type() == Percent in WebCore::Length::percent
+This test passes if there's no crash.
+

Added: trunk/LayoutTests/fast/css/calculated-length-as-percent-crash.html (0 => 153981)


--- trunk/LayoutTests/fast/css/calculated-length-as-percent-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/calculated-length-as-percent-crash.html	2013-08-13 06:26:45 UTC (rev 153981)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<head>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+</script>
+</head>
+<body>
+<div>
+Test for <a href="" #116715</a>: ASSERTION FAILED: type() == Percent in WebCore::Length::percent<br>
+This test passes if there's no crash.
+</div>
+<table>
+<tr>
+<td scope="col" colspan="5" style="width: -webkit-calc(100% + -100px);"></td>
+</tr>
+</table>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (153980 => 153981)


--- trunk/Source/WebCore/ChangeLog	2013-08-13 06:26:29 UTC (rev 153980)
+++ trunk/Source/WebCore/ChangeLog	2013-08-13 06:26:45 UTC (rev 153981)
@@ -1,3 +1,20 @@
+2013-08-12  Zan Dobersek  <[email protected]>
+
+        ASSERTION FAILED: type() == Percent in WebCore::Length::percent
+        https://bugs.webkit.org/show_bug.cgi?id=116715
+
+        Reviewed by Darin Adler.
+
+        Allow the Calculated type in the Length::percent method that returns the Length's
+        float value. This reflects the changes in r110148 that adjusted the Length::isPercent
+        method to return true for Length objects of either Percent or Calculated type.
+
+        Test: fast/css/calculated-length-as-percent-crash.html
+
+        * platform/Length.h:
+        (WebCore::Length::percent): Assert that Length::isPercent is true when Length::percent
+        is called, ensuring the Length's type is either Percent or Calculated.
+
 2013-06-16  Darin Adler  <[email protected]>
 
         Move Clipboard::declareAndWriteDragImage to DragController

Modified: trunk/Source/WebCore/platform/Length.h (153980 => 153981)


--- trunk/Source/WebCore/platform/Length.h	2013-08-13 06:26:29 UTC (rev 153980)
+++ trunk/Source/WebCore/platform/Length.h	2013-08-13 06:26:45 UTC (rev 153981)
@@ -136,7 +136,7 @@
 
     float percent() const
     {
-        ASSERT(type() == Percent);
+        ASSERT(isPercent());
         return getFloatValue();
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to