https://bugs.webkit.org/show_bug.cgi?id=129656
Reviewed by Simon Fraser.
outlineBoundsForRepaint() is expected to return the outline repaint rect. Using enclosingIntRect()
to calculate the outline boundaries breaks repaint logic in RenderElement::repaintAfterLayoutIfNeeded().
Since enclosingIntRect() can return bigger rect than repaint rect, the old/new bounds' dimensions could end up
being different which triggers the size change repaint code path.
Source/WebCore:
Test: fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::outlineBoundsForRepaint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintAfterLayoutIfNeeded):
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::outlineBoundsForRepaint):
LayoutTests:
* fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move-expected.txt: Added.
* fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165113
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-03-05 Zalan Bujtas <zalan@apple.com>
+
+ Subpixel rendering: Wrong cliprect on absolute positioned elements.
+ https://bugs.webkit.org/show_bug.cgi?id=129656
+
+ Reviewed by Simon Fraser.
+
+ outlineBoundsForRepaint() is expected to return the outline repaint rect. Using enclosingIntRect()
+ to calculate the outline boundaries breaks repaint logic in RenderElement::repaintAfterLayoutIfNeeded().
+ Since enclosingIntRect() can return bigger rect than repaint rect, the old/new bounds' dimensions could end up
+ being different which triggers the size change repaint code path.
+
+ * fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move-expected.txt: Added.
+ * fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move.html: Added.
+
2014-03-05 Chang Shu <cshu@webkit.org>
Copying wrapping text results in multiple spaces between wrapped lines stripped.
--- /dev/null
+(repaint rects
+ (rect 0 0 22 22)
+ (rect 0.50 0 22 22)
+ (rect 25 0 22 22)
+ (rect 25.50 0 22 22)
+ (rect 50 0 22 22)
+ (rect 50.50 0 22 22)
+ (rect 75 0 22 22)
+ (rect 75.50 0 22 22)
+ (rect 100 0 22 22)
+ (rect 100.50 0 22 22)
+ (rect 125 0 22 22)
+ (rect 125.50 0 22 22)
+ (rect 150 0 22 22)
+ (rect 150.50 0 22 22)
+ (rect 175 0 22 22)
+ (rect 175.50 0 22 22)
+ (rect 200 0 22 22)
+ (rect 200.50 0 22 22)
+ (rect 225 0 22 22)
+ (rect 225.50 0 22 22)
+)
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests absolute positioned elements' repaint clipping after move. Pass if all borders are painted properly.</title>
+<head>
+<style>
+ div {
+ position: absolute;
+ border: green solid 1px;
+ width: 20px;
+ height: 20px;
+ left: 0px;
+ top: 0px;
+ }
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+ var container = document.getElementById("container");
+ for (j = 0; j < 10; ++j) {
+ var e = document.createElement("div");
+ e.style.left = (25 * j) + "px";
+ container.appendChild(e);
+ }
+
+ function move() {
+ divs = document.getElementsByTagName("div");
+ for (i = 0; i < divs.length; ++i)
+ divs[i].style.left = (parseFloat(divs[i].style.left) + 0.3) + "px";
+
+ if (window.testRunner && window.internals) {
+ var dummy = document.body.offsetTop;
+ var repaintRects = window.internals.repaintRectsAsText();
+ window.internals.stopTrackingRepaints();
+
+ var pre = document.createElement('pre');
+ document.body.appendChild(pre);
+ pre.innerHTML = repaintRects;
+ testRunner.notifyDone();
+ }
+ }
+
+ if (window.testRunner && window.internals) {
+ window.testRunner.dumpAsText(false);
+ window.internals.startTrackingRepaints();
+ testRunner.waitUntilDone();
+ }
+
+ setTimeout(move, 0);
+</script>
+</body>
+</html>
+2014-03-05 Zalan Bujtas <zalan@apple.com>
+
+ Subpixel rendering: Wrong cliprect on absolute positioned elements.
+ https://bugs.webkit.org/show_bug.cgi?id=129656
+
+ Reviewed by Simon Fraser.
+
+ outlineBoundsForRepaint() is expected to return the outline repaint rect. Using enclosingIntRect()
+ to calculate the outline boundaries breaks repaint logic in RenderElement::repaintAfterLayoutIfNeeded().
+ Since enclosingIntRect() can return bigger rect than repaint rect, the old/new bounds' dimensions could end up
+ being different which triggers the size change repaint code path.
+
+ Test: fast/repaint/hidpi-absolute-positioned-element-wrong-cliprect-after-move.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::outlineBoundsForRepaint):
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
+ * rendering/svg/RenderSVGModelObject.cpp:
+ (WebCore::RenderSVGModelObject::outlineBoundsForRepaint):
+
2014-03-05 Krzysztof Czech <k.czech@samsung.com>
[ATK] Expose missing functionalities of AtkTableCell to AT.
else
containerRelativeQuad = localToContainerQuad(FloatRect(box), repaintContainer);
- box = containerRelativeQuad.enclosingBoundingBox();
+ box = LayoutRect(containerRelativeQuad.boundingBox());
}
// FIXME: layoutDelta needs to be applied in parts before/after transforms and
// repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
box.move(view().layoutDelta());
- return box;
+ return LayoutRect(pixelSnappedForPainting(box, document().deviceScaleFactor()));
}
void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderLayerModelObject*)
LayoutUnit shadowLeft;
LayoutUnit shadowRight;
style().getBoxShadowHorizontalExtent(shadowLeft, shadowRight);
- int borderRight = isBox() ? toRenderBox(this)->borderRight() : LayoutUnit::fromPixel(0);
+ LayoutUnit borderRight = isBox() ? toRenderBox(this)->borderRight() : LayoutUnit::fromPixel(0);
LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit();
LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min<LayoutUnit>(newBounds.width(), oldBounds.width()));
LayoutUnit borderWidth = std::max<LayoutUnit>(borderRight, std::max<LayoutUnit>(valueForLength(style().borderTopRightRadius().width(), boxWidth, &view()), valueForLength(style().borderBottomRightRadius().width(), boxWidth)));
LayoutUnit shadowTop;
LayoutUnit shadowBottom;
style().getBoxShadowVerticalExtent(shadowTop, shadowBottom);
- int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : LayoutUnit::fromPixel(0);
+ LayoutUnit borderBottom = isBox() ? toRenderBox(this)->borderBottom() : LayoutUnit::fromPixel(0);
LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit();
LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min<LayoutUnit>(newBounds.height(), oldBounds.height()));
LayoutUnit borderHeight = std::max<LayoutUnit>(borderBottom, std::max<LayoutUnit>(valueForLength(style().borderBottomLeftRadius().height(), boxHeight), valueForLength(style().borderBottomRightRadius().height(), boxHeight, &view())));
adjustRectForOutlineAndShadow(box);
FloatQuad containerRelativeQuad = localToContainerQuad(FloatRect(box), repaintContainer);
- return containerRelativeQuad.enclosingBoundingBox();
+ return LayoutRect(pixelSnappedForPainting(LayoutRect(containerRelativeQuad.boundingBox()), document().deviceScaleFactor()));
}
void RenderSVGModelObject::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const