Title: [198771] trunk
Revision
198771
Author
[email protected]
Date
2016-03-28 18:06:56 -0700 (Mon, 28 Mar 2016)

Log Message

Pixel turds when bordered div is resized on SMF forum software.
https://bugs.webkit.org/show_bug.cgi?id=155957
<rdar://problem/25010646>

Reviewed by Simon Fraser.

Use unmodified, non-snapped bounding box rect when computing dirty rects.

Source/WebCore:

Test: fast/repaint/hidpi-box-with-subpixel-height-inflates.html

* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::getTrailingCorner):
* rendering/RenderInline.h:
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::borderBoundingBox): Deleted.
* rendering/RenderLineBreak.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::setBestTruncatedAt):

LayoutTests:

* fast/repaint/hidpi-box-with-subpixel-height-inflates-expected.txt: Added.
* fast/repaint/hidpi-box-with-subpixel-height-inflates.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (198770 => 198771)


--- trunk/LayoutTests/ChangeLog	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/LayoutTests/ChangeLog	2016-03-29 01:06:56 UTC (rev 198771)
@@ -1,3 +1,16 @@
+2016-03-28  Zalan Bujtas  <[email protected]>
+
+        Pixel turds when bordered div is resized on SMF forum software.
+        https://bugs.webkit.org/show_bug.cgi?id=155957
+        <rdar://problem/25010646>
+
+        Reviewed by Simon Fraser.
+
+        Use unmodified, non-snapped bounding box rect when computing dirty rects.
+
+        * fast/repaint/hidpi-box-with-subpixel-height-inflates-expected.txt: Added.
+        * fast/repaint/hidpi-box-with-subpixel-height-inflates.html: Added.
+
 2016-03-28  Chris Fleizach  <[email protected]>
 
         AX: Crash when AX trying to create element for an old auto fill element

Added: trunk/LayoutTests/fast/repaint/hidpi-box-with-subpixel-height-inflates-expected.txt (0 => 198771)


--- trunk/LayoutTests/fast/repaint/hidpi-box-with-subpixel-height-inflates-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/hidpi-box-with-subpixel-height-inflates-expected.txt	2016-03-29 01:06:56 UTC (rev 198771)
@@ -0,0 +1,12 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+(repaint rects
+(rect 0 49.50 22 152.50)
+(rect 0 48.50 22 1)
+(rect 0 49.50 800 152.50)
+(rect 0 49.50 800 152.50)
+(rect 1 1 1 47.50)
+(rect 1 1 1 200)
+)
+

Added: trunk/LayoutTests/fast/repaint/hidpi-box-with-subpixel-height-inflates.html (0 => 198771)


--- trunk/LayoutTests/fast/repaint/hidpi-box-with-subpixel-height-inflates.html	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/hidpi-box-with-subpixel-height-inflates.html	2016-03-29 01:06:56 UTC (rev 198771)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<script>jsTestIsAsync = true;</script>
+<script src=""
+<head>
+<title>This tests repainting with subpixel height values.</title>
+<style>
+body { 
+    margin: 0px;
+}
+
+.container {
+    border: 1px solid green;
+    width: 20px;
+}
+
+#foobar {
+    background: blue;
+    width: 1px;
+    position: relative;
+	font: 99% Ahem;
+	height: 3em;
+}
+
+</style>
+</head>
+<body>
+<div class=container><div id=foobar></div></div>
+<script>
+setTimeout(function() { 
+    if (window.internals)
+        internals.startTrackingRepaints();
+    document.getElementById("foobar").style.height = "200px";
+    document.body.offsetWidth;
+
+    if (window.internals) {
+        document.body.innerText = window.internals.repaintRectsAsText();
+        internals.stopTrackingRepaints();
+    }
+    finishJSTest();
+}, 0);
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (198770 => 198771)


--- trunk/Source/WebCore/ChangeLog	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/ChangeLog	2016-03-29 01:06:56 UTC (rev 198771)
@@ -1,3 +1,26 @@
+2016-03-28  Zalan Bujtas  <[email protected]>
+
+        Pixel turds when bordered div is resized on SMF forum software.
+        https://bugs.webkit.org/show_bug.cgi?id=155957
+        <rdar://problem/25010646>
+
+        Reviewed by Simon Fraser.
+
+        Use unmodified, non-snapped bounding box rect when computing dirty rects.
+
+        Test: fast/repaint/hidpi-box-with-subpixel-height-inflates.html
+
+        * rendering/RenderBox.h:
+        * rendering/RenderBoxModelObject.h:
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::getTrailingCorner):
+        * rendering/RenderInline.h:
+        * rendering/RenderLineBreak.cpp:
+        (WebCore::RenderLineBreak::borderBoundingBox): Deleted.
+        * rendering/RenderLineBreak.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::setBestTruncatedAt):
+
 2016-03-28  Chris Fleizach  <[email protected]>
 
         AX: Crash when AX trying to create element for an old auto fill element

Modified: trunk/Source/WebCore/rendering/RenderBox.h (198770 => 198771)


--- trunk/Source/WebCore/rendering/RenderBox.h	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2016-03-29 01:06:56 UTC (rev 198771)
@@ -153,7 +153,7 @@
     }
     LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
     LayoutRect paddingBoxRect() const { return LayoutRect(borderLeft(), borderTop(), contentWidth() + paddingLeft() + paddingRight(), contentHeight() + paddingTop() + paddingBottom()); }
-    IntRect borderBoundingBox() const final { return enclosingIntRect(borderBoxRect()); }
+    LayoutRect borderBoundingBox() const final { return borderBoxRect(); }
 
     WEBCORE_EXPORT RoundedRect::Radii borderRadii() const;
 

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.h (198770 => 198771)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.h	2016-03-29 01:06:56 UTC (rev 198771)
@@ -130,7 +130,7 @@
     bool requiresLayer() const override { return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection(); }
 
     // This will work on inlines to return the bounding box of all of the lines' border boxes.
-    virtual IntRect borderBoundingBox() const = 0;
+    virtual LayoutRect borderBoundingBox() const = 0;
 
     // These return the CSS computed padding values.
     LayoutUnit computedCSSPaddingTop() const { return computedCSSPadding(style().paddingTop()); }

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (198770 => 198771)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2016-03-29 01:06:56 UTC (rev 198771)
@@ -1730,7 +1730,7 @@
         if (is<RenderText>(*o) || o->isReplaced()) {
             point = FloatPoint();
             if (is<RenderText>(*o)) {
-                IntRect linesBox = downcast<RenderText>(*o).linesBoundingBox();
+                LayoutRect linesBox = downcast<RenderText>(*o).linesBoundingBox();
                 if (!linesBox.maxX() && !linesBox.maxY())
                     continue;
                 point.moveBy(linesBox.maxXMaxYCorner());

Modified: trunk/Source/WebCore/rendering/RenderInline.h (198770 => 198771)


--- trunk/Source/WebCore/rendering/RenderInline.h	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/rendering/RenderInline.h	2016-03-29 01:06:56 UTC (rev 198771)
@@ -53,10 +53,9 @@
 
     LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const final;
 
-    IntRect borderBoundingBox() const final
+    LayoutRect borderBoundingBox() const final
     {
-        IntRect boundingBox = linesBoundingBox();
-        return IntRect(0, 0, boundingBox.width(), boundingBox.height());
+        return LayoutRect(LayoutPoint(), linesBoundingBox().size());
     }
 
     WEBCORE_EXPORT IntRect linesBoundingBox() const;

Modified: trunk/Source/WebCore/rendering/RenderLineBreak.cpp (198770 => 198771)


--- trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.cpp	2016-03-29 01:06:56 UTC (rev 198771)
@@ -225,11 +225,6 @@
     m_cachedLineHeight = invalidLineHeight;
 }
 
-IntRect RenderLineBreak::borderBoundingBox() const
-{
-    return IntRect(IntPoint(), linesBoundingBox().size());
-}
-
 #if PLATFORM(IOS)
 void RenderLineBreak::collectSelectionRects(Vector<SelectionRect>& rects, unsigned, unsigned)
 {

Modified: trunk/Source/WebCore/rendering/RenderLineBreak.h (198770 => 198771)


--- trunk/Source/WebCore/rendering/RenderLineBreak.h	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.h	2016-03-29 01:06:56 UTC (rev 198771)
@@ -82,7 +82,7 @@
     LayoutUnit marginEnd(const RenderStyle*) const override { return 0; }
     LayoutUnit offsetWidth() const override { return linesBoundingBox().width(); }
     LayoutUnit offsetHeight() const override { return linesBoundingBox().height(); }
-    IntRect borderBoundingBox() const override;
+    LayoutRect borderBoundingBox() const override { return LayoutRect(LayoutPoint(), linesBoundingBox().size()); }
     LayoutRect frameRectForStickyPositioning() const override { ASSERT_NOT_REACHED(); return LayoutRect(); }
     LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const override { return LayoutRect(); }
 

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (198770 => 198771)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2016-03-29 01:06:56 UTC (rev 198771)
@@ -1251,7 +1251,7 @@
     }
 
     // Prefer the widest object that tries to move the pagination point
-    IntRect boundingBox = forRenderer->borderBoundingBox();
+    LayoutRect boundingBox = forRenderer->borderBoundingBox();
     if (boundingBox.width() > m_legacyPrinting.m_truncatorWidth) {
         m_legacyPrinting.m_truncatorWidth = boundingBox.width();
         m_legacyPrinting.m_bestTruncatedAt = y;

Modified: trunk/Source/WebKit2/Shared/WebRenderObject.cpp (198770 => 198771)


--- trunk/Source/WebKit2/Shared/WebRenderObject.cpp	2016-03-29 00:59:07 UTC (rev 198770)
+++ trunk/Source/WebKit2/Shared/WebRenderObject.cpp	2016-03-29 01:06:56 UTC (rev 198771)
@@ -106,7 +106,7 @@
         m_frameRect = downcast<RenderText>(*renderer).linesBoundingBox();
         m_frameRect.setLocation(downcast<RenderText>(*renderer).firstRunLocation());
     } else if (is<RenderInline>(*renderer))
-        m_frameRect = downcast<RenderInline>(*renderer).borderBoundingBox();
+        m_frameRect = IntRect(downcast<RenderInline>(*renderer).borderBoundingBox());
 
     if (!shouldIncludeDescendants)
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to