Title: [128346] trunk
Revision
128346
Author
le...@chromium.org
Date
2012-09-12 12:17:03 -0700 (Wed, 12 Sep 2012)

Log Message

Inline repainting can be off-by-one with sub-pixel enabled
https://bugs.webkit.org/show_bug.cgi?id=95882

Reviewed by Eric Seidel.

Source/WebCore: 

With sub-pixel layout enabled, context accumulated from containing renderers is used to properly
pixel snap. Selection repaint rects are stored outside the affected renderers, and are handed to
the embedder without the context to correctly determine the snapped values. This can result in
repaint areas smaller than what's needed.

This could be fixed three ways:
- by changing selection repaint rects to an IntRect and pixel snapping the values before storing
  them outside the render tree. This is the narrowest solution.
- by adapting layout to store pixel snapping hints along with the size/location of the renderer.
  This is the best possible solution, as it would help solve a lot of pixel snapping issues and
  reduce complexity of handling. I eventually intend on implementing this.
- by reverting repaintUsingContainer to IntRects and using pixel snapping when possible, and
  enclosingIntRect where we lack context.

This implements the last solution, as it's the least invasive, but can potentially fix numerous
sub-pixel repaint issues.

Test: fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::layoutRunsAndFloats):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::repaintIncludingNonCompositingDescendants):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintUsingContainer):
(WebCore::RenderObject::repaint):
(WebCore::RenderObject::repaintRectangle):
(WebCore::RenderObject::repaintAfterLayoutIfNeeded):
* rendering/RenderObject.h:
(RenderObject):
* rendering/RenderSelectionInfo.h:
(WebCore::RenderSelectionInfo::repaint):
(WebCore::RenderBlockSelectionInfo::repaint):

LayoutTests: 

Test that we properly repaint selection gaps inside tables with sub-pixel offsets.

* fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt: Added.
* fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html: Added.
* platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png: Added.
* platform/chromium/TestExpectations:
* platform/mac-lion/Skipped:
* platform/mac-snowleopard/Skipped:
* platform/mac-wk2/Skipped:
* platform/mac/Skipped:
* platform/qt-4.8/Skipped:
* platform/qt/Skipped:
* platform/win-wk2/Skipped:
* platform/win-xp/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:
* platform/wk2/Skipped:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (128345 => 128346)


--- trunk/LayoutTests/ChangeLog	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/ChangeLog	2012-09-12 19:17:03 UTC (rev 128346)
@@ -1,3 +1,28 @@
+2012-09-12  Levi Weintraub  <le...@chromium.org>
+
+        Inline repainting can be off-by-one with sub-pixel enabled
+        https://bugs.webkit.org/show_bug.cgi?id=95882
+
+        Reviewed by Eric Seidel.
+
+        Test that we properly repaint selection gaps inside tables with sub-pixel offsets.
+
+        * fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt: Added.
+        * fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html: Added.
+        * platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png: Added.
+        * platform/chromium/TestExpectations:
+        * platform/mac-lion/Skipped:
+        * platform/mac-snowleopard/Skipped:
+        * platform/mac-wk2/Skipped:
+        * platform/mac/Skipped:
+        * platform/qt-4.8/Skipped:
+        * platform/qt/Skipped:
+        * platform/win-wk2/Skipped:
+        * platform/win-xp/Skipped:
+        * platform/win/Skipped:
+        * platform/wincairo/Skipped:
+        * platform/wk2/Skipped:
+
 2012-09-12  Zan Dobersek  <zandober...@gmail.com>
 
         Unreviewed GTK gardening.

Added: trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt (0 => 128346)


--- trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt	2012-09-12 19:17:03 UTC (rev 128346)
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x8
+  RenderBlock {HTML} at (0,0) size 800x8
+    RenderBody {BODY} at (8,8) size 784x0
+layer at (8,2) size 321x43
+  RenderTable {TABLE} at (8,1) size 321x44
+    RenderTableSection {TBODY} at (0,0) size 321x43
+      RenderTableRow {TR} at (0,2) size 321x39
+        RenderTableCell {TD} at (2,2) size 317x40 [r=0 c=0 rs=1 cs=1]
+          RenderBlock {PRE} at (1,12) size 315x15
+            RenderText {#text} at (0,0) size 315x14
+              text run at (0,0) width 315: "There should be no selection artifacts below."
+              text run at (315,0) width 0: " "

Added: trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html (0 => 128346)


--- trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html	2012-09-12 19:17:03 UTC (rev 128346)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+::selection { background-color: red; }
+pre {
+  font-size: 110%;
+}
+body {
+  font: 82% arial,sans-serif;
+}
+</style>
+<script src="" type="text/_javascript_"></script>
+<script>
+function repaintTest() {
+	window.getSelection().removeAllRanges();
+}
+</script>
+</head>
+<body _onload_="runRepaintTest()">
+<table style="position: absolute; top: 1.5px;">
+  <tr>
+  	<td>
+<pre id="pre">There should be no selection artifacts below.
+</pre>
+    </td>
+  </tr>
+</table>
+<script type="text/_javascript_">
+var text = document.getElementById("pre").firstChild;
+window.getSelection().setBaseAndExtent(text, 0, text, text.length);
+document.body.offsetTop;
+</script>
+</body>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (128345 => 128346)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-09-12 19:17:03 UTC (rev 128346)
@@ -3427,6 +3427,9 @@
 
 BUGWK94256 DEBUG : fast/block/inline-children-root-linebox-crash.html = PASS CRASH
 
+// Need baselines after bots cycle
+BUGLEVIW LINUX WIN SNOWLEOPARD : fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html = PASS IMAGE IMAGE+TEXT MISSING
+
 // Following tests need baselines on Win and Linux 
 BUGWK94492 WIN LINUX : css3/filters/custom/custom-filter-color-matrix.html = IMAGE
 BUGWK94492 WIN LINUX : css3/filters/custom/custom-filter-composite-source-atop.html = IMAGE

Added: trunk/LayoutTests/platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png ___________________________________________________________________

Added: svn:mime-type

Modified: trunk/LayoutTests/platform/mac/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/mac/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/mac/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -824,6 +824,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # No CORS support for media elements is implemented yet.
 http/tests/security/video-cross-origin-readback.html

Modified: trunk/LayoutTests/platform/mac-lion/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/mac-lion/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/mac-lion/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -118,6 +118,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # This media test always failed on Lion
 # https://bugs.webkit.org/show_bug.cgi?id=86527 and <rdar://problem/11458493>

Modified: trunk/LayoutTests/platform/mac-snowleopard/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/mac-snowleopard/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/mac-snowleopard/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -212,6 +212,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # Frame::findString does nothing on pages that prevent selection
 # https://bugs.webkit.org/show_bug.cgi?id=40361

Modified: trunk/LayoutTests/platform/mac-wk2/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/mac-wk2/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/mac-wk2/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -216,6 +216,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # fast/events/pagehide-timeout.html, pageshow-pagehide-on-back-cached-with-frames.html, and
 # pageshow-pagehide-on-back-cached.html flakey on Lion Intel Debug WebKit testers.

Modified: trunk/LayoutTests/platform/qt/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/qt/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/qt/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -307,6 +307,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # CSS Regions support not yet enabled. http://webkit.org/b/57312
 fast/regions

Modified: trunk/LayoutTests/platform/qt-4.8/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/qt-4.8/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/qt-4.8/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -105,6 +105,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # SVG Fonts are only supported when using QRawFont, which is not
 # supported with Qt 4.

Modified: trunk/LayoutTests/platform/win/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/win/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/win/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -1745,6 +1745,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # No CORS support for media elements is implemented yet.
 http/tests/security/video-cross-origin-readback.html

Modified: trunk/LayoutTests/platform/win-wk2/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/win-wk2/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/win-wk2/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -949,6 +949,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # HiDPI tests require test infrastructure enhancements
 fast/hidpi

Modified: trunk/LayoutTests/platform/win-xp/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/win-xp/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/win-xp/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -48,6 +48,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # REGRESSION (r83928 or before): Some tests failing assertions in MarkStack::internalAppend / MarkStack::drain
 # https://bugs.webkit.org/show_bug.cgi?id=58657

Modified: trunk/LayoutTests/platform/wincairo/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/wincairo/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/wincairo/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -2134,6 +2134,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 #Battery Status API is not implemented.
 batterystatus

Modified: trunk/LayoutTests/platform/wk2/Skipped (128345 => 128346)


--- trunk/LayoutTests/platform/wk2/Skipped	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/LayoutTests/platform/wk2/Skipped	2012-09-12 19:17:03 UTC (rev 128346)
@@ -97,6 +97,7 @@
 fast/sub-pixel/size-of-box-with-zoom.html
 fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 
 # [WK2][WTR] svg/animations/animate-text-nested-transforms.html fails
 # https://bugs.webkit.org/show_bug.cgi?id=95191

Modified: trunk/Source/WebCore/ChangeLog (128345 => 128346)


--- trunk/Source/WebCore/ChangeLog	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/Source/WebCore/ChangeLog	2012-09-12 19:17:03 UTC (rev 128346)
@@ -1,3 +1,46 @@
+2012-09-12  Levi Weintraub  <le...@chromium.org>
+
+        Inline repainting can be off-by-one with sub-pixel enabled
+        https://bugs.webkit.org/show_bug.cgi?id=95882
+
+        Reviewed by Eric Seidel.
+
+        With sub-pixel layout enabled, context accumulated from containing renderers is used to properly
+        pixel snap. Selection repaint rects are stored outside the affected renderers, and are handed to
+        the embedder without the context to correctly determine the snapped values. This can result in
+        repaint areas smaller than what's needed.
+
+        This could be fixed three ways:
+        - by changing selection repaint rects to an IntRect and pixel snapping the values before storing
+          them outside the render tree. This is the narrowest solution.
+        - by adapting layout to store pixel snapping hints along with the size/location of the renderer.
+          This is the best possible solution, as it would help solve a lot of pixel snapping issues and
+          reduce complexity of handling. I eventually intend on implementing this.
+        - by reverting repaintUsingContainer to IntRects and using pixel snapping when possible, and
+          enclosingIntRect where we lack context.
+
+        This implements the last solution, as it's the least invasive, but can potentially fix numerous
+        sub-pixel repaint issues.
+
+        Test: fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::layoutRunsAndFloats):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+        (WebCore::RenderLayer::scrollTo):
+        (WebCore::RenderLayer::repaintIncludingNonCompositingDescendants):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::repaintUsingContainer):
+        (WebCore::RenderObject::repaint):
+        (WebCore::RenderObject::repaintRectangle):
+        (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
+        * rendering/RenderObject.h:
+        (RenderObject):
+        * rendering/RenderSelectionInfo.h:
+        (WebCore::RenderSelectionInfo::repaint):
+        (WebCore::RenderBlockSelectionInfo::repaint):
+
 2012-09-12  Michael Saboff  <msab...@apple.com>
 
         Build fixed for http://trac.webkit.org/changeset/128243

Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (128345 => 128346)


--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp	2012-09-12 19:17:03 UTC (rev 128346)
@@ -1232,7 +1232,7 @@
             // that the block really needed a full layout, we missed our chance to repaint the layer
             // before layout started.  Luckily the layer has cached the repaint rect for its original
             // position and size, and so we can use that to make a repaint happen now.
-            repaintUsingContainer(containerForRepaint(), layer()->repaintRect());
+            repaintUsingContainer(containerForRepaint(), pixelSnappedIntRect(layer()->repaintRect()));
         }
     }
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (128345 => 128346)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-09-12 19:17:03 UTC (rev 128346)
@@ -400,9 +400,9 @@
         if (flags & CheckForRepaint) {
             if (view && !view->printing()) {
                 if (m_repaintStatus & NeedsFullRepaint) {
-                    renderer()->repaintUsingContainer(repaintContainer, oldRepaintRect);
+                    renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldRepaintRect));
                     if (m_repaintRect != oldRepaintRect)
-                        renderer()->repaintUsingContainer(repaintContainer, m_repaintRect);
+                        renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_repaintRect));
                 } else if (shouldRepaintAfterLayout())
                     renderer()->repaintAfterLayoutIfNeeded(repaintContainer, oldRepaintRect, oldOutlineBox, &m_repaintRect, &m_outlineBox);
             }
@@ -1733,7 +1733,7 @@
 
     // Just schedule a full repaint of our object.
     if (view && !usesCompositedScrolling())
-        renderer()->repaintUsingContainer(repaintContainer, m_repaintRect);
+        renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_repaintRect));
 
     // Schedule the scroll DOM event.
     if (renderer()->node())
@@ -4801,7 +4801,7 @@
 // Since we're only painting non-composited layers, we know that they all share the same repaintContainer.
 void RenderLayer::repaintIncludingNonCompositingDescendants(RenderBoxModelObject* repaintContainer)
 {
-    renderer()->repaintUsingContainer(repaintContainer, renderer()->clippedOverflowRectForRepaint(repaintContainer));
+    renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(renderer()->clippedOverflowRectForRepaint(repaintContainer)));
 
     for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) {
         if (!curr->isComposited())

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (128345 => 128346)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2012-09-12 19:17:03 UTC (rev 128346)
@@ -1277,7 +1277,7 @@
     return repaintContainer;
 }
 
-void RenderObject::repaintUsingContainer(RenderBoxModelObject* repaintContainer, const LayoutRect& r, bool immediate) const
+void RenderObject::repaintUsingContainer(RenderBoxModelObject* repaintContainer, const IntRect& r, bool immediate) const
 {
     if (!repaintContainer) {
         view()->repaintViewRectangle(r, immediate);
@@ -1304,7 +1304,7 @@
         if (!viewHasCompositedLayer || v->layer()->backing()->paintsIntoWindow()) {
             LayoutRect repaintRectangle = r;
             if (viewHasCompositedLayer &&  v->layer()->transform())
-                repaintRectangle = v->layer()->transform()->mapRect(r);
+                repaintRectangle = enclosingIntRect(v->layer()->transform()->mapRect(r));
             v->repaintViewRectangle(repaintRectangle, immediate);
             return;
         }
@@ -1331,7 +1331,7 @@
         return; // Don't repaint if we're printing.
 
     RenderBoxModelObject* repaintContainer = containerForRepaint();
-    repaintUsingContainer(repaintContainer ? repaintContainer : view, clippedOverflowRectForRepaint(repaintContainer), immediate);
+    repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(clippedOverflowRectForRepaint(repaintContainer)), immediate);
 }
 
 void RenderObject::repaintRectangle(const LayoutRect& r, bool immediate) const
@@ -1352,7 +1352,7 @@
 
     RenderBoxModelObject* repaintContainer = containerForRepaint();
     computeRectForRepaint(repaintContainer, dirtyRect);
-    repaintUsingContainer(repaintContainer ? repaintContainer : view, dirtyRect, immediate);
+    repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(dirtyRect), immediate);
 }
 
 IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
@@ -1387,9 +1387,9 @@
         repaintContainer = v;
 
     if (fullRepaint) {
-        repaintUsingContainer(repaintContainer, oldBounds);
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds));
         if (newBounds != oldBounds)
-            repaintUsingContainer(repaintContainer, newBounds);
+            repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds));
         return true;
     }
 
@@ -1398,27 +1398,27 @@
 
     LayoutUnit deltaLeft = newBounds.x() - oldBounds.x();
     if (deltaLeft > 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height()));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), deltaLeft, oldBounds.height()));
     else if (deltaLeft < 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height()));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), -deltaLeft, newBounds.height()));
 
     LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX();
     if (deltaRight > 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()));
     else if (deltaRight < 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()));
 
     LayoutUnit deltaTop = newBounds.y() - oldBounds.y();
     if (deltaTop > 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), oldBounds.y(), oldBounds.width(), deltaTop));
     else if (deltaTop < 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), newBounds.y(), newBounds.width(), -deltaTop));
 
     LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY();
     if (deltaBottom > 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom));
     else if (deltaBottom < 0)
-        repaintUsingContainer(repaintContainer, LayoutRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom));
+        repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom));
 
     if (newOutlineBox == oldOutlineBox)
         return false;
@@ -1443,7 +1443,7 @@
         LayoutUnit right = min<LayoutUnit>(newBounds.maxX(), oldBounds.maxX());
         if (rightRect.x() < right) {
             rightRect.setWidth(min(rightRect.width(), right - rightRect.x()));
-            repaintUsingContainer(repaintContainer, rightRect);
+            repaintUsingContainer(repaintContainer, pixelSnappedIntRect(rightRect));
         }
     }
     LayoutUnit height = absoluteValue(newOutlineBox.height() - oldOutlineBox.height());
@@ -1462,7 +1462,7 @@
         LayoutUnit bottom = min(newBounds.maxY(), oldBounds.maxY());
         if (bottomRect.y() < bottom) {
             bottomRect.setHeight(min(bottomRect.height(), bottom - bottomRect.y()));
-            repaintUsingContainer(repaintContainer, bottomRect);
+            repaintUsingContainer(repaintContainer, pixelSnappedIntRect(bottomRect));
         }
     }
     return false;

Modified: trunk/Source/WebCore/rendering/RenderObject.h (128345 => 128346)


--- trunk/Source/WebCore/rendering/RenderObject.h	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2012-09-12 19:17:03 UTC (rev 128346)
@@ -756,7 +756,7 @@
     RenderBoxModelObject* containerForRepaint() const;
     // Actually do the repaint of rect r for this object which has been computed in the coordinate space
     // of repaintContainer. If repaintContainer is 0, repaint via the view.
-    void repaintUsingContainer(RenderBoxModelObject* repaintContainer, const LayoutRect&, bool immediate = false) const;
+    void repaintUsingContainer(RenderBoxModelObject* repaintContainer, const IntRect&, bool immediate = false) const;
     
     // Repaint the entire object.  Called when, e.g., the color of a border changes, or when a border
     // style changes.

Modified: trunk/Source/WebCore/rendering/RenderSelectionInfo.h (128345 => 128346)


--- trunk/Source/WebCore/rendering/RenderSelectionInfo.h	2012-09-12 19:02:39 UTC (rev 128345)
+++ trunk/Source/WebCore/rendering/RenderSelectionInfo.h	2012-09-12 19:17:03 UTC (rev 128346)
@@ -68,7 +68,7 @@
     
     void repaint()
     {
-        m_object->repaintUsingContainer(m_repaintContainer, m_rect);
+        m_object->repaintUsingContainer(m_repaintContainer, enclosingIntRect(m_rect));
     }
 
     LayoutRect rect() const { return m_rect; }
@@ -89,7 +89,7 @@
 
     void repaint()
     {
-        m_object->repaintUsingContainer(m_repaintContainer, m_rects);
+        m_object->repaintUsingContainer(m_repaintContainer, enclosingIntRect(m_rects));
     }
     
     RenderBlock* block() const { return toRenderBlock(m_object); }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to