Title: [205392] trunk
Revision
205392
Author
[email protected]
Date
2016-09-02 17:53:39 -0700 (Fri, 02 Sep 2016)

Log Message

Should never be reached failure in WebCore::floatValueForLength
https://bugs.webkit.org/show_bug.cgi?id=139397
<rdar://problem/27704376>

Reviewed by Simon Fraser.

Source/WebCore:

floatValueForLength can't resolve unspecified Length types. Filter them out and return 0 as if they were auto.

Test: svg/css/assert-on-non-resolvable-dimension.html

* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength):

LayoutTests:

* svg/css/assert-on-non-resolvable-dimension-expected.txt: Added.
* svg/css/assert-on-non-resolvable-dimension.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (205391 => 205392)


--- trunk/LayoutTests/ChangeLog	2016-09-03 00:34:26 UTC (rev 205391)
+++ trunk/LayoutTests/ChangeLog	2016-09-03 00:53:39 UTC (rev 205392)
@@ -1,3 +1,14 @@
+2016-09-02  Zalan Bujtas  <[email protected]>
+
+        Should never be reached failure in WebCore::floatValueForLength
+        https://bugs.webkit.org/show_bug.cgi?id=139397
+        <rdar://problem/27704376>
+
+        Reviewed by Simon Fraser.
+
+        * svg/css/assert-on-non-resolvable-dimension-expected.txt: Added.
+        * svg/css/assert-on-non-resolvable-dimension.html: Added.
+
 2016-09-02  Ryan Haddad  <[email protected]>
 
         Rebaseline editing/secure-input/removed-password-input.html after r205381.

Added: trunk/LayoutTests/svg/css/assert-on-non-resolvable-dimension-expected.txt (0 => 205392)


--- trunk/LayoutTests/svg/css/assert-on-non-resolvable-dimension-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/svg/css/assert-on-non-resolvable-dimension-expected.txt	2016-09-03 00:53:39 UTC (rev 205392)
@@ -0,0 +1 @@
+PASS if no assert in debug. 

Added: trunk/LayoutTests/svg/css/assert-on-non-resolvable-dimension.html (0 => 205392)


--- trunk/LayoutTests/svg/css/assert-on-non-resolvable-dimension.html	                        (rev 0)
+++ trunk/LayoutTests/svg/css/assert-on-non-resolvable-dimension.html	2016-09-03 00:53:39 UTC (rev 205392)
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we don't assert on non-resolvable values.</title>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+PASS if no assert in debug.
+<svg>
+    <rect style="width: -webkit-fit-content;"></rect>
+    <rect sstyle="width: max-content;">foobar</rect>
+    <rect sstyle="width: min-content;">foobar</rect>
+    <rect sstyle="width: fit-content;">foobar</rect>
+    <rect sstyle="width: intrinsic;">foobar</rect>
+    <rect sstyle="width: min-intrinsic;">foobar</rect>
+    <rect sstyle="width: relative;">foobar</rect>
+    <rect sstyle="width: undefined;">foobar</rect>
+</svg>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (205391 => 205392)


--- trunk/Source/WebCore/ChangeLog	2016-09-03 00:34:26 UTC (rev 205391)
+++ trunk/Source/WebCore/ChangeLog	2016-09-03 00:53:39 UTC (rev 205392)
@@ -1,3 +1,18 @@
+2016-09-02  Zalan Bujtas  <[email protected]>
+
+        Should never be reached failure in WebCore::floatValueForLength
+        https://bugs.webkit.org/show_bug.cgi?id=139397
+        <rdar://problem/27704376>
+
+        Reviewed by Simon Fraser.
+
+        floatValueForLength can't resolve unspecified Length types. Filter them out and return 0 as if they were auto.
+
+        Test: svg/css/assert-on-non-resolvable-dimension.html
+
+        * svg/SVGLengthContext.cpp:
+        (WebCore::SVGLengthContext::valueForLength):
+
 2016-09-02  Joseph Pecoraro  <[email protected]>
 
         [Mac] Remove unnecessary RetainPtr in NeverDestroyed value

Modified: trunk/Source/WebCore/svg/SVGLengthContext.cpp (205391 => 205392)


--- trunk/Source/WebCore/svg/SVGLengthContext.cpp	2016-09-03 00:34:26 UTC (rev 205391)
+++ trunk/Source/WebCore/svg/SVGLengthContext.cpp	2016-09-03 00:53:39 UTC (rev 205392)
@@ -91,7 +91,7 @@
 {
     if (length.isPercent())
         return convertValueFromPercentageToUserUnits(length.value() / 100, mode, IGNORE_EXCEPTION);
-    if (length.isAuto())
+    if (length.isAuto() || !length.isSpecified())
         return 0;
 
     FloatSize viewportSize;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to