Title: [195197] releases/WebKitGTK/webkit-2.10
Revision
195197
Author
[email protected]
Date
2016-01-18 03:41:34 -0800 (Mon, 18 Jan 2016)

Log Message

Merge r194418 - ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide
https://bugs.webkit.org/show_bug.cgi?id=151210

Reviewed by Simon Fraser.

Source/WebCore:

"IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect first and
returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
the snapped rect might become smaller than the inner rect.

This patch also enables outline painting on subpixel positions.

Tests: fast/borders/hidpi-outline-on-subpixel-position.html
       fast/borders/outline-offset-overflow.html

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

LayoutTests:

"IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect and
returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
the snapped outer rect becomes smaller than the inner rect.

This patch also enables outline painting on subpixel positions.

* fast/borders/hidpi-outline-on-subpixel-position-expected.html: Added.
* fast/borders/hidpi-outline-on-subpixel-position.html: Added.
* fast/borders/outline-offset-overflow-expected.txt: Added.
* fast/borders/outline-offset-overflow.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195196 => 195197)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-18 11:36:45 UTC (rev 195196)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog	2016-01-18 11:41:34 UTC (rev 195197)
@@ -1,3 +1,21 @@
+2015-12-24  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide
+        https://bugs.webkit.org/show_bug.cgi?id=151210
+
+        Reviewed by Simon Fraser.
+
+        "IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect and
+        returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
+        the snapped outer rect becomes smaller than the inner rect.
+
+        This patch also enables outline painting on subpixel positions.
+
+        * fast/borders/hidpi-outline-on-subpixel-position-expected.html: Added.
+        * fast/borders/hidpi-outline-on-subpixel-position.html: Added.
+        * fast/borders/outline-offset-overflow-expected.txt: Added.
+        * fast/borders/outline-offset-overflow.html: Added.
+
 2015-12-23  Simon Fraser  <[email protected]>
 
         REGRESSION (r187593): Scroll position jumps when selecting text in an iframe

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/hidpi-outline-on-subpixel-position-expected.html (0 => 195197)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/hidpi-outline-on-subpixel-position-expected.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/hidpi-outline-on-subpixel-position-expected.html	2016-01-18 11:41:34 UTC (rev 195197)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests outlines on subpixel positions</title>
+<style>
+  div {
+    position: absolute;
+    height: 5px;
+    width: 5px;
+    left: 1px;
+    top: 1px;
+    border: solid 1px green;
+  }
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+  var container = document.getElementById("container");
+  var leftPos = 0;
+  var topPos = 0;
+  var subpixelOffset = 0;
+  for (var i = 0; i < 50; ++i) {
+    var e = document.createElement("div");
+    e.style.left = leftPos + "px";
+    e.style.top = topPos + "px";
+    container.appendChild(e);
+    subpixelOffset += 0.1;
+    leftPos += 5 + subpixelOffset;
+    topPos += 5 + subpixelOffset;
+  }
+</script>
+</body>
+</html>

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/hidpi-outline-on-subpixel-position.html (0 => 195197)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/hidpi-outline-on-subpixel-position.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/hidpi-outline-on-subpixel-position.html	2016-01-18 11:41:34 UTC (rev 195197)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests outlines on subpixel positions</title>
+<style>
+  div {
+    position: absolute;
+    height: 5px;
+    width: 5px;
+    left: 1px;
+    top: 1px;
+    outline: solid 1px green;
+  }
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+  var container = document.getElementById("container");
+  var leftPos = 1;
+  var topPos = 1;
+  var subpixelOffset = 0;
+  for (var i = 0; i < 50; ++i) {
+    var e = document.createElement("div");
+    e.style.left = leftPos + "px";
+    e.style.top = topPos + "px";
+    container.appendChild(e);
+    subpixelOffset += 0.1;
+    leftPos += 5 + subpixelOffset;
+    topPos += 5 + subpixelOffset;
+  }
+</script>
+</body>
+</html>

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/outline-offset-overflow-expected.txt (0 => 195197)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/outline-offset-overflow-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/outline-offset-overflow-expected.txt	2016-01-18 11:41:34 UTC (rev 195197)
@@ -0,0 +1 @@
+Pass if no assert in debug.

Added: releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/outline-offset-overflow.html (0 => 195197)


--- releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/outline-offset-overflow.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/fast/borders/outline-offset-overflow.html	2016-01-18 11:41:34 UTC (rev 195197)
@@ -0,0 +1,11 @@
+<script>
+  if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+<style>
+div {
+    outline-style: solid;
+    outline-offset: 46392551rem;
+}
+</style>
+<div>Pass if no assert in debug.</div>
\ No newline at end of file

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195196 => 195197)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-18 11:36:45 UTC (rev 195196)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-18 11:41:34 UTC (rev 195197)
@@ -1,3 +1,22 @@
+2015-12-24  Zalan Bujtas  <[email protected]>
+
+        ASSERTION FAILED: x2 >= x1 in WebCore::RenderElement::drawLineForBoxSide
+        https://bugs.webkit.org/show_bug.cgi?id=151210
+
+        Reviewed by Simon Fraser.
+
+        "IntRect outer = snappedIntRect(inner)" explicitly converts inner to LayoutRect first and
+        returns a snapped IntRect. When inner (after the inflate) overflows LayoutUnit,
+        the snapped rect might become smaller than the inner rect.
+
+        This patch also enables outline painting on subpixel positions.
+
+        Tests: fast/borders/hidpi-outline-on-subpixel-position.html
+               fast/borders/outline-offset-overflow.html
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::paintOutline):
+
 2015-12-23  Simon Fraser  <[email protected]>
 
         REGRESSION (r187593): Scroll position jumps when selecting text in an iframe

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


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderElement.cpp	2016-01-18 11:36:45 UTC (rev 195196)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderElement.cpp	2016-01-18 11:41:34 UTC (rev 195197)
@@ -2068,12 +2068,11 @@
     if (styleToUse.outlineStyleIsAuto() || styleToUse.outlineStyle() == BNONE)
         return;
 
-    IntRect inner = snappedIntRect(paintRect);
-    inner.inflate(outlineOffset);
+    FloatRect outer = paintRect;
+    outer.inflate(outlineOffset + outlineWidth);
+    FloatRect inner = outer;
+    inner.inflate(-outlineWidth);
 
-    IntRect outer = snappedIntRect(inner);
-    outer.inflate(outlineWidth);
-
     // FIXME: This prevents outlines from painting inside the object. See bug 12042
     if (outer.isEmpty())
         return;
@@ -2097,14 +2096,14 @@
         outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineColor.blue());
     }
 
-    int leftOuter = outer.x();
-    int leftInner = inner.x();
-    int rightOuter = outer.maxX();
-    int rightInner = inner.maxX();
-    int topOuter = outer.y();
-    int topInner = inner.y();
-    int bottomOuter = outer.maxY();
-    int bottomInner = inner.maxY();
+    float leftOuter = outer.x();
+    float leftInner = inner.x();
+    float rightOuter = outer.maxX();
+    float rightInner = std::min(inner.maxX(), rightOuter);
+    float topOuter = outer.y();
+    float topInner = inner.y();
+    float bottomOuter = outer.maxY();
+    float bottomInner = std::min(inner.maxY(), bottomOuter);
 
     drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(leftOuter, topOuter), FloatPoint(leftInner, bottomOuter)), BSLeft, outlineColor, outlineStyle, outlineWidth, outlineWidth);
     drawLineForBoxSide(graphicsContext, FloatRect(FloatPoint(leftOuter, topOuter), FloatPoint(rightOuter, topInner)), BSTop, outlineColor, outlineStyle, outlineWidth, outlineWidth);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to