Title: [199441] releases/WebKitGTK/webkit-2.12
Revision
199441
Author
[email protected]
Date
2016-04-13 02:17:48 -0700 (Wed, 13 Apr 2016)

Log Message

Merge r198597 - ASSERTION FAILED: y2 >= y1 in WebCore::RenderElement::drawLineForBoxSide
https://bugs.webkit.org/show_bug.cgi?id=155791

Reviewed by Simon Fraser.

With certain combination of border rect and adjacent width, we could end up with an empty final rect.
This patch ensures that we don't try to paint this empty rect.

Source/WebCore:

Test: fast/borders/empty-outline-border-assert.html

* rendering/RenderElement.cpp:
(WebCore::RenderElement::drawLineForBoxSide):

LayoutTests:

* fast/borders/empty-outline-border-assert-expected.txt: Added.
* fast/borders/empty-outline-border-assert.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog (199440 => 199441)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-04-13 09:16:42 UTC (rev 199440)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/ChangeLog	2016-04-13 09:17:48 UTC (rev 199441)
@@ -1,3 +1,16 @@
+2016-03-23  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: y2 >= y1 in WebCore::RenderElement::drawLineForBoxSide
+        https://bugs.webkit.org/show_bug.cgi?id=155791
+
+        Reviewed by Simon Fraser.
+
+        With certain combination of border rect and adjacent width, we could end up with an empty final rect.
+        This patch ensures that we don't try to paint this empty rect. 
+
+        * fast/borders/empty-outline-border-assert-expected.txt: Added.
+        * fast/borders/empty-outline-border-assert.html: Added.
+
 2016-03-23  Brent Fulgham  <[email protected]>
 
         [WebGL] Non-power-of-two texture optimization

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/borders/empty-outline-border-assert-expected.txt (0 => 199441)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/borders/empty-outline-border-assert-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/borders/empty-outline-border-assert-expected.txt	2016-04-13 09:17:48 UTC (rev 199441)
@@ -0,0 +1 @@
+PASS if no ASSERT in debug. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 

Added: releases/WebKitGTK/webkit-2.12/LayoutTests/fast/borders/empty-outline-border-assert.html (0 => 199441)


--- releases/WebKitGTK/webkit-2.12/LayoutTests/fast/borders/empty-outline-border-assert.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.12/LayoutTests/fast/borders/empty-outline-border-assert.html	2016-04-13 09:17:48 UTC (rev 199441)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we don't try to draw no-op borders.</title>
+<style>
+* {
+    vertical-align: super;
+    outline-style: double;
+}
+</style>
+</head>
+<body>
+PASS if no ASSERT in debug.
+<mark>
+    <datalist>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+        <iframe></iframe>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+        <textarea></textarea>
+    </datalist>
+</mark>
+</body>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</html>
\ No newline at end of file

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (199440 => 199441)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-04-13 09:16:42 UTC (rev 199440)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-04-13 09:17:48 UTC (rev 199441)
@@ -1,3 +1,18 @@
+2016-03-23  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: y2 >= y1 in WebCore::RenderElement::drawLineForBoxSide
+        https://bugs.webkit.org/show_bug.cgi?id=155791
+
+        Reviewed by Simon Fraser.
+
+        With certain combination of border rect and adjacent width, we could end up with an empty final rect.
+        This patch ensures that we don't try to paint this empty rect. 
+
+        Test: fast/borders/empty-outline-border-assert.html
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::drawLineForBoxSide):
+
 2016-03-23  Brent Fulgham  <[email protected]>
 
         [WebGL] Non-power-of-two texture optimization

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderElement.cpp (199440 => 199441)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderElement.cpp	2016-04-13 09:16:42 UTC (rev 199440)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/rendering/RenderElement.cpp	2016-04-13 09:17:48 UTC (rev 199441)
@@ -1829,6 +1829,13 @@
         graphicsContext.drawRect(rect);
     };
 
+    auto drawLineFor = [this, &graphicsContext, color, antialias] (const FloatRect& rect, BoxSide side, EBorderStyle borderStyle, const FloatSize& adjacent)
+    {
+        if (rect.isEmpty())
+            return;
+        drawLineForBoxSide(graphicsContext, rect, side, color, borderStyle, adjacent.width(), adjacent.height(), antialias);
+    };
+
     float x1 = rect.x();
     float x2 = rect.maxX();
     float y1 = rect.y();
@@ -1911,39 +1918,31 @@
             switch (side) {
             case BSTop:
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x1 + mitreOffset1, y1, (x2 - mitreOffset3) - (x1 + mitreOffset1), thirdOfThickness), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
 
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x1 + mitreOffset2, y2 - thirdOfThickness, (x2 - mitreOffset4) - (x1 + mitreOffset2), thirdOfThickness), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
                 break;
             case BSLeft:
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x1, y1 + mitreOffset1, thirdOfThickness, (y2 - mitreOffset3) - (y1 + mitreOffset1)), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
 
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x2 - thirdOfThickness, y1 + mitreOffset2, thirdOfThickness, (y2 - mitreOffset4) - (y1 + mitreOffset2)), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
                 break;
             case BSBottom:
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x1 + mitreOffset2, y1, (x2 - mitreOffset4) - (x1 + mitreOffset2), thirdOfThickness), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
 
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x1 + mitreOffset1, y2 - thirdOfThickness, (x2 - mitreOffset3) - (x1 + mitreOffset1), thirdOfThickness), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
                 break;
             case BSRight:
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x1, y1 + mitreOffset2, thirdOfThickness, (y2 - mitreOffset4) - (y1 + mitreOffset2)), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
 
                 paintBorderRect = snapRectToDevicePixels(LayoutRect(x2 - thirdOfThickness, y1 + mitreOffset1, thirdOfThickness, (y2 - mitreOffset3) - (y1 + mitreOffset1)), deviceScaleFactor);
-                drawLineForBoxSide(graphicsContext, paintBorderRect, side, color, SOLID,
-                    adjacent1BigThird, adjacent2BigThird, antialias);
+                drawLineFor(paintBorderRect, side, SOLID, FloatSize(adjacent1BigThird, adjacent2BigThird));
                 break;
             default:
                 break;
@@ -1996,20 +1995,20 @@
 
         switch (side) {
         case BSTop:
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(x1 + offset1, y1), FloatPoint(x2 - offset2, adjustedY)), side, color, s1, adjacent1BigHalf, adjacent2BigHalf, antialias);
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(x1 + offset3, adjustedY), FloatPoint(x2 - offset4, y2)), side, color, s2, adjacent1SmallHalf, adjacent2SmallHalf, antialias);
+            drawLineFor(FloatRect(FloatPoint(x1 + offset1, y1), FloatPoint(x2 - offset2, adjustedY)), side, s1, FloatSize(adjacent1BigHalf, adjacent2BigHalf));
+            drawLineFor(FloatRect(FloatPoint(x1 + offset3, adjustedY), FloatPoint(x2 - offset4, y2)), side, s2, FloatSize(adjacent1SmallHalf, adjacent2SmallHalf));
             break;
         case BSLeft:
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(x1, y1 + offset1), FloatPoint(adjustedX, y2 - offset2)), side, color, s1, adjacent1BigHalf, adjacent2BigHalf, antialias);
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(adjustedX, y1 + offset3), FloatPoint(x2, y2 - offset4)), side, color, s2, adjacent1SmallHalf, adjacent2SmallHalf, antialias);
+            drawLineFor(FloatRect(FloatPoint(x1, y1 + offset1), FloatPoint(adjustedX, y2 - offset2)), side, s1, FloatSize(adjacent1BigHalf, adjacent2BigHalf));
+            drawLineFor(FloatRect(FloatPoint(adjustedX, y1 + offset3), FloatPoint(x2, y2 - offset4)), side, s2, FloatSize(adjacent1SmallHalf, adjacent2SmallHalf));
             break;
         case BSBottom:
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(x1 + offset1, y1), FloatPoint(x2 - offset2, adjustedY)), side, color, s2, adjacent1BigHalf, adjacent2BigHalf, antialias);
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(x1 + offset3, adjustedY), FloatPoint(x2 - offset4, y2)), side, color, s1, adjacent1SmallHalf, adjacent2SmallHalf, antialias);
+            drawLineFor(FloatRect(FloatPoint(x1 + offset1, y1), FloatPoint(x2 - offset2, adjustedY)), side, s2, FloatSize(adjacent1BigHalf, adjacent2BigHalf));
+            drawLineFor(FloatRect(FloatPoint(x1 + offset3, adjustedY), FloatPoint(x2 - offset4, y2)), side, s1, FloatSize(adjacent1SmallHalf, adjacent2SmallHalf));
             break;
         case BSRight:
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(x1, y1 + offset1), FloatPoint(adjustedX, y2 - offset2)), side, color, s2, adjacent1BigHalf, adjacent2BigHalf, antialias);
-            drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(adjustedX, y1 + offset3), FloatPoint(x2, y2 - offset4)), side, color, s1, adjacent1SmallHalf, adjacent2SmallHalf, antialias);
+            drawLineFor(FloatRect(FloatPoint(x1, y1 + offset1), FloatPoint(adjustedX, y2 - offset2)), side, s2, FloatSize(adjacent1BigHalf, adjacent2BigHalf));
+            drawLineFor(FloatRect(FloatPoint(adjustedX, y1 + offset3), FloatPoint(x2, y2 - offset4)), side, s1, FloatSize(adjacent1SmallHalf, adjacent2SmallHalf));
             break;
         }
         break;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to