Diff
Copied: branches/chromium/1229/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt (from rev 128346, trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt) (0 => 129033)
--- branches/chromium/1229/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt (rev 0)
+++ branches/chromium/1229/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.txt 2012-09-19 19:19:51 UTC (rev 129033)
@@ -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: " "
Copied: branches/chromium/1229/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html (from rev 128346, trunk/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html) (0 => 129033)
--- branches/chromium/1229/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html (rev 0)
+++ branches/chromium/1229/LayoutTests/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html 2012-09-19 19:19:51 UTC (rev 129033)
@@ -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>
Copied: branches/chromium/1229/LayoutTests/platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png (from rev 128346, trunk/LayoutTests/platform/chromium-mac/fast/sub-pixel/selection/selection-rect-in-sub-pixel-table-expected.png)
(Binary files differ)
Modified: branches/chromium/1229/LayoutTests/platform/mac/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/mac/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/mac/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -828,6 +828,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.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: branches/chromium/1229/LayoutTests/platform/mac-lion/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/mac-lion/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/mac-lion/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -117,6 +117,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.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: branches/chromium/1229/LayoutTests/platform/mac-snowleopard/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/mac-snowleopard/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/mac-snowleopard/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -211,6 +211,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.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: branches/chromium/1229/LayoutTests/platform/mac-wk2/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/mac-wk2/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/mac-wk2/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -217,6 +217,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.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: branches/chromium/1229/LayoutTests/platform/qt/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/qt/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/qt/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -284,6 +284,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.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: branches/chromium/1229/LayoutTests/platform/qt-4.8/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/qt-4.8/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/qt-4.8/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -104,6 +104,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.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: branches/chromium/1229/LayoutTests/platform/win/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/win/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/win/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -1735,6 +1735,7 @@
fast/sub-pixel/large-sizes.html
fast/sub-pixel/layout-boxes-with-zoom.html
fast/sub-pixel/size-of-box-with-zoom.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
# http://webkit.org/b/82886
inspector/styles/override-screen-size.html
Modified: branches/chromium/1229/LayoutTests/platform/win-wk2/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/win-wk2/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/win-wk2/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -950,6 +950,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
# HiDPI tests require test infrastructure enhancements
fast/hidpi
Modified: branches/chromium/1229/LayoutTests/platform/win-xp/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/win-xp/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/win-xp/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -50,6 +50,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.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: branches/chromium/1229/LayoutTests/platform/wincairo/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/wincairo/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/wincairo/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -2131,6 +2131,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
#Battery Status API is not implemented.
batterystatus
Modified: branches/chromium/1229/LayoutTests/platform/wk2/Skipped (129032 => 129033)
--- branches/chromium/1229/LayoutTests/platform/wk2/Skipped 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/LayoutTests/platform/wk2/Skipped 2012-09-19 19:19:51 UTC (rev 129033)
@@ -100,6 +100,7 @@
fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
fast/sub-pixel/size-of-box-with-zoom.html
fast/sub-pixel/table-rows-no-gaps.html
+fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
# CONSOLE MESSAGE: line 0: SVG animation pause API missing!
# [WK2] SVG animation pause API missing
Modified: branches/chromium/1229/Source/WebCore/rendering/RenderBlockLineLayout.cpp (129032 => 129033)
--- branches/chromium/1229/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2012-09-19 19:19:51 UTC (rev 129033)
@@ -1196,7 +1196,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: branches/chromium/1229/Source/WebCore/rendering/RenderLayer.cpp (129032 => 129033)
--- branches/chromium/1229/Source/WebCore/rendering/RenderLayer.cpp 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderLayer.cpp 2012-09-19 19:19:51 UTC (rev 129033)
@@ -397,9 +397,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);
}
@@ -1693,7 +1693,7 @@
// Just schedule a full repaint of our object.
if (view)
- renderer()->repaintUsingContainer(repaintContainer, m_repaintRect);
+ renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(m_repaintRect));
// Schedule the scroll DOM event.
if (renderer()->node())
@@ -4745,7 +4745,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: branches/chromium/1229/Source/WebCore/rendering/RenderObject.cpp (129032 => 129033)
--- branches/chromium/1229/Source/WebCore/rendering/RenderObject.cpp 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderObject.cpp 2012-09-19 19:19:51 UTC (rev 129033)
@@ -1261,7 +1261,7 @@
return repaintContainer;
}
-void RenderObject::repaintUsingContainer(RenderBoxModelObject* repaintContainer, const LayoutRect& r, bool immediate)
+void RenderObject::repaintUsingContainer(RenderBoxModelObject* repaintContainer, const IntRect& r, bool immediate) const
{
if (!repaintContainer) {
view()->repaintViewRectangle(r, immediate);
@@ -1288,7 +1288,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;
}
@@ -1315,7 +1315,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)
@@ -1336,7 +1336,7 @@
RenderBoxModelObject* repaintContainer = containerForRepaint();
computeRectForRepaint(repaintContainer, dirtyRect);
- repaintUsingContainer(repaintContainer ? repaintContainer : view, dirtyRect, immediate);
+ repaintUsingContainer(repaintContainer ? repaintContainer : view, pixelSnappedIntRect(dirtyRect), immediate);
}
IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const
@@ -1371,9 +1371,9 @@
repaintContainer = v;
if (fullRepaint) {
- repaintUsingContainer(repaintContainer, oldBounds);
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(oldBounds));
if (newBounds != oldBounds)
- repaintUsingContainer(repaintContainer, newBounds);
+ repaintUsingContainer(repaintContainer, pixelSnappedIntRect(newBounds));
return true;
}
@@ -1382,27 +1382,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;
@@ -1427,7 +1427,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());
@@ -1446,7 +1446,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: branches/chromium/1229/Source/WebCore/rendering/RenderObject.h (129032 => 129033)
--- branches/chromium/1229/Source/WebCore/rendering/RenderObject.h 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderObject.h 2012-09-19 19:19:51 UTC (rev 129033)
@@ -738,7 +738,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);
+ 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: branches/chromium/1229/Source/WebCore/rendering/RenderSelectionInfo.h (129032 => 129033)
--- branches/chromium/1229/Source/WebCore/rendering/RenderSelectionInfo.h 2012-09-19 19:17:47 UTC (rev 129032)
+++ branches/chromium/1229/Source/WebCore/rendering/RenderSelectionInfo.h 2012-09-19 19:19:51 UTC (rev 129033)
@@ -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); }