Title: [195127] releases/WebKitGTK/webkit-2.10
Revision
195127
Author
[email protected]
Date
2016-01-15 05:11:26 -0800 (Fri, 15 Jan 2016)

Log Message

Merge r194002 - ASSERTION FAILED: !rect.isEmpty() in WebCore::GraphicsContext::drawRect
https://bugs.webkit.org/show_bug.cgi?id=151201

Reviewed by Simon Fraser.

Drawing empty rect is a waste.

Source/WebCore:

Test: fast/borders/empty-drawrect-assert-after-pixelsnap.html

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

LayoutTests:

* fast/borders/empty-drawrect-assert-after-pixelsnap-expected.txt: Added.
* fast/borders/empty-drawrect-assert-after-pixelsnap.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195126 => 195127)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-15 13:10:09 UTC (rev 195126)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-15 13:11:26 UTC (rev 195127)
@@ -1,3 +1,15 @@
+2015-12-11  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: !rect.isEmpty() in WebCore::GraphicsContext::drawRect
+        https://bugs.webkit.org/show_bug.cgi?id=151201
+
+        Reviewed by Simon Fraser.
+
+        Drawing empty rect is a waste.
+
+        * fast/borders/empty-drawrect-assert-after-pixelsnap-expected.txt: Added.
+        * fast/borders/empty-drawrect-assert-after-pixelsnap.html: Added.
+
 2015-12-11  Jiewen Tan  <[email protected]>
 
         Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/empty-drawrect-assert-after-pixelsnap-expected.txt (0 => 195127)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/empty-drawrect-assert-after-pixelsnap-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/empty-drawrect-assert-after-pixelsnap-expected.txt	2016-01-15 13:11:26 UTC (rev 195127)
@@ -0,0 +1,2 @@
+Pass if no assert in debug.
+

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/empty-drawrect-assert-after-pixelsnap.html (0 => 195127)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/empty-drawrect-assert-after-pixelsnap.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/empty-drawrect-assert-after-pixelsnap.html	2016-01-15 13:11:26 UTC (rev 195127)
@@ -0,0 +1,16 @@
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+h3 {
+    border-top : 1px solid red;
+}
+* {
+    padding-inline-start : 91%;
+    -webkit-padding-start : 91%;
+    margin: auto auto;
+}
+</style>
+Pass if no assert in debug.
+<h3><dt><h3></h3></dt></h3>

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195126 => 195127)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-15 13:10:09 UTC (rev 195126)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-15 13:11:26 UTC (rev 195127)
@@ -1,3 +1,17 @@
+2015-12-11  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: !rect.isEmpty() in WebCore::GraphicsContext::drawRect
+        https://bugs.webkit.org/show_bug.cgi?id=151201
+
+        Reviewed by Simon Fraser.
+
+        Drawing empty rect is a waste.
+
+        Test: fast/borders/empty-drawrect-assert-after-pixelsnap.html
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::drawLineForBoxSide):
+
 2015-12-11  Jiewen Tan  <[email protected]>
 
         Strip out Referer header when requesting subresources or following links for documents with "Content-Disposition: attachment"

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderElement.cpp (195126 => 195127)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderElement.cpp	2016-01-15 13:10:09 UTC (rev 195126)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderElement.cpp	2016-01-15 13:11:26 UTC (rev 195127)
@@ -1775,6 +1775,13 @@
 
 void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const FloatRect& rect, BoxSide side, Color color, EBorderStyle borderStyle, float adjacentWidth1, float adjacentWidth2, bool antialias) const
 {
+    auto drawBorderRect = [&graphicsContext] (const FloatRect& rect)
+    {
+        if (rect.isEmpty())
+            return;
+        graphicsContext.drawRect(rect);
+    };
+
     float x1 = rect.x();
     float x2 = rect.maxX();
     float y1 = rect.y();
@@ -1830,13 +1837,13 @@
             switch (side) {
             case BSTop:
             case BSBottom:
-                graphicsContext.drawRect(snapRectToDevicePixels(x1, y1, length, thirdOfThickness, deviceScaleFactor));
-                graphicsContext.drawRect(snapRectToDevicePixels(x1, y2 - thirdOfThickness, length, thirdOfThickness, deviceScaleFactor));
+                drawBorderRect(snapRectToDevicePixels(x1, y1, length, thirdOfThickness, deviceScaleFactor));
+                drawBorderRect(snapRectToDevicePixels(x1, y2 - thirdOfThickness, length, thirdOfThickness, deviceScaleFactor));
                 break;
             case BSLeft:
             case BSRight:
-                graphicsContext.drawRect(snapRectToDevicePixels(x1, y1, thirdOfThickness, length, deviceScaleFactor));
-                graphicsContext.drawRect(snapRectToDevicePixels(x2 - thirdOfThickness, y1, thirdOfThickness, length, deviceScaleFactor));
+                drawBorderRect(snapRectToDevicePixels(x1, y1, thirdOfThickness, length, deviceScaleFactor));
+                drawBorderRect(snapRectToDevicePixels(x2 - thirdOfThickness, y1, thirdOfThickness, length, deviceScaleFactor));
                 break;
             }
 
@@ -1976,7 +1983,7 @@
             graphicsContext.setFillColor(color, style.colorSpace());
             bool wasAntialiased = graphicsContext.shouldAntialias();
             graphicsContext.setShouldAntialias(antialias);
-            graphicsContext.drawRect(snapRectToDevicePixels(x1, y1, x2 - x1, y2 - y1, deviceScaleFactor));
+            drawBorderRect(snapRectToDevicePixels(x1, y1, x2 - x1, y2 - y1, deviceScaleFactor));
             graphicsContext.setShouldAntialias(wasAntialiased);
             graphicsContext.setStrokeStyle(oldStrokeStyle);
             return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to