Title: [145139] trunk
Revision
145139
Author
hy...@apple.com
Date
2013-03-07 14:33:25 -0800 (Thu, 07 Mar 2013)

Log Message

REGRESSION: fast/border/border-fit-2.html needs updating
https://bugs.webkit.org/show_bug.cgi?id=111776

Reviewed by Simon Fraser.

Source/WebCore: 

This test is incorrectly shrinking the border image now.
We need to apply some clamping to the border-fit like the
old code did. The pixel results *are* still changing though,
since a layout-time shrinkage will not result in right-aligned
boxes in an LTR block when the left edge gets chopped. We'll
have to see if this behavioral change ends up being a problem,
but for now we'll rebaseline and assume it will be ok.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::fitBorderToLinesIfNeeded):

LayoutTests: 

* platform/mac/fast/borders/border-fit-2-expected.png:
* platform/mac/fast/borders/border-fit-2-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (145138 => 145139)


--- trunk/LayoutTests/ChangeLog	2013-03-07 22:32:12 UTC (rev 145138)
+++ trunk/LayoutTests/ChangeLog	2013-03-07 22:33:25 UTC (rev 145139)
@@ -1,3 +1,13 @@
+2013-03-07  David Hyatt  <hy...@apple.com>
+
+        REGRESSION: fast/border/border-fit-2.html needs updating
+        https://bugs.webkit.org/show_bug.cgi?id=111776
+
+        Reviewed by Simon Fraser.
+
+        * platform/mac/fast/borders/border-fit-2-expected.png:
+        * platform/mac/fast/borders/border-fit-2-expected.txt:
+
 2013-03-07  Antoine Quint  <grao...@apple.com>
 
         Web Inspector: provide reasons why a layer was composited in the LayerTreeAgent

Modified: trunk/LayoutTests/platform/mac/fast/borders/border-fit-2-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/fast/borders/border-fit-2-expected.txt (145138 => 145139)


--- trunk/LayoutTests/platform/mac/fast/borders/border-fit-2-expected.txt	2013-03-07 22:32:12 UTC (rev 145138)
+++ trunk/LayoutTests/platform/mac/fast/borders/border-fit-2-expected.txt	2013-03-07 22:33:25 UTC (rev 145139)
@@ -3,7 +3,7 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 784x51 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderBlock {DIV} at (0,0) size 51x51 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
         RenderBlock {DIV} at (1,21) size 0x0
-      RenderBlock {DIV} at (0,51) size 784x51 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
-        RenderBlock {DIV} at (774,21) size 0x0
+      RenderBlock {DIV} at (0,51) size 51x51 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+        RenderBlock {DIV} at (41,21) size 0x0

Modified: trunk/Source/WebCore/ChangeLog (145138 => 145139)


--- trunk/Source/WebCore/ChangeLog	2013-03-07 22:32:12 UTC (rev 145138)
+++ trunk/Source/WebCore/ChangeLog	2013-03-07 22:33:25 UTC (rev 145139)
@@ -1,3 +1,21 @@
+2013-03-07  David Hyatt  <hy...@apple.com>
+
+        REGRESSION: fast/border/border-fit-2.html needs updating
+        https://bugs.webkit.org/show_bug.cgi?id=111776
+
+        Reviewed by Simon Fraser.
+
+        This test is incorrectly shrinking the border image now.
+        We need to apply some clamping to the border-fit like the
+        old code did. The pixel results *are* still changing though,
+        since a layout-time shrinkage will not result in right-aligned
+        boxes in an LTR block when the left edge gets chopped. We'll
+        have to see if this behavioral change ends up being a problem,
+        but for now we'll rebaseline and assume it will be ok.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::fitBorderToLinesIfNeeded):
+
 2013-03-07  Antoine Quint  <grao...@apple.com>
 
         Web Inspector: provide reasons why a layer was composited in the LayerTreeAgent

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (145138 => 145139)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-03-07 22:32:12 UTC (rev 145138)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-03-07 22:33:25 UTC (rev 145139)
@@ -6874,9 +6874,13 @@
     LayoutUnit right = LayoutUnit::min();
     LayoutUnit oldWidth = contentWidth();
     adjustForBorderFit(0, left, right);
-    left = max(borderLeft() + paddingLeft(), left);
-    right = min(borderLeft() + paddingLeft() + contentWidth(), right);
     
+    // Clamp to our existing edges. We can never grow. We only shrink.
+    LayoutUnit leftEdge = borderLeft() + paddingLeft();
+    LayoutUnit rightEdge = leftEdge + oldWidth;
+    left = min(rightEdge, max(leftEdge, left));
+    right = max(leftEdge, min(rightEdge, right));
+    
     LayoutUnit newContentWidth = right - left;
     if (newContentWidth == oldWidth)
         return;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to