Index: Source/WebCore/rendering/RenderLayer.cpp |
=================================================================== |
--- Source/WebCore/rendering/RenderLayer.cpp (revision 141156) |
+++ Source/WebCore/rendering/RenderLayer.cpp (working copy) |
@@ -2095,17 +2095,21 @@ |
// This will prevent us from revealing text hidden by the slider in Safari RSS. |
RenderBox* box = renderBox(); |
ASSERT(box); |
- LayoutRect localExposeRect(box->absoluteToLocalQuad(FloatQuad(FloatRect(rect)), UseTransforms).boundingBox()); |
- LayoutRect layerBounds(0, 0, box->clientWidth(), box->clientHeight()); |
- LayoutRect r = getRectToExpose(layerBounds, localExposeRect, alignX, alignY); |
+ FloatPoint absPos = box->localToAbsolute(); |
+ absPos.move(box->borderLeft(), box->borderTop()); |
- IntSize clampedScrollOffset = clampScrollOffset(scrollOffset() + toIntSize(roundedIntRect(r).location())); |
+ LayoutRect layerBounds = LayoutRect(absPos.x() + scrollXOffset(), absPos.y() + scrollYOffset(), box->clientWidth(), box->clientHeight()); |
+ LayoutRect exposeRect = LayoutRect(rect.x() + scrollXOffset(), rect.y() + scrollYOffset(), rect.width(), rect.height()); |
+ LayoutRect r = getRectToExpose(layerBounds, exposeRect, alignX, alignY); |
+ |
+ int roundedAdjustedX = roundToInt(r.x() - absPos.x()); |
+ int roundedAdjustedY = roundToInt(r.y() - absPos.y()); |
+ IntSize clampedScrollOffset = clampScrollOffset(IntSize(roundedAdjustedX, roundedAdjustedY)); |
if (clampedScrollOffset != scrollOffset()) { |
IntSize oldScrollOffset = scrollOffset(); |
scrollToOffset(clampedScrollOffset); |
IntSize scrollOffsetDifference = scrollOffset() - oldScrollOffset; |
- localExposeRect.move(-scrollOffsetDifference); |
- newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(localExposeRect)), UseTransforms).boundingBox()); |
+ newRect.move(-scrollOffsetDifference); |
} |
} else if (!parentLayer && renderer()->isBox() && renderBox()->canBeProgramaticallyScrolled()) { |
if (frameView) { |
@@ -2132,8 +2136,6 @@ |
frameView->setScrollPosition(IntPoint(xOffset, yOffset)); |
if (frameView->safeToPropagateScrollToParent()) { |
parentLayer = ownerElement->renderer()->enclosingLayer(); |
- // FIXME: This doesn't correctly convert the rect to |
- // absolute coordinates in the parent. |
newRect.setX(rect.x() - frameView->scrollX() + frameView->x()); |
newRect.setY(rect.y() - frameView->scrollY() + frameView->y()); |
} else |