Commit 0278dd62 authored by hyatt's avatar hyatt

Fix for bug 11595. Autoscrolling of layers didn't really work at all...

        Fix for bug 11595.  Autoscrolling of layers didn't really work at all unless the layer was coincidentally
        in the root layer's coordinate space.  The event point was an absolute position within the document, but
        the layer's rect was only local coords.  This patch makes sure to use absolute bounds for the layer
        when comparing it with the point.

        This is covered by the scrollRevealButton test case already in the tree... the results change to be more
        correct.

        Reviewed by ggaren

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollRectToVisible):



git-svn-id: svn://svn.chromium.org/blink/trunk@18796 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 078aa111
2007-01-11 David Hyatt <hyatt@apple.com>
Fix for bug 11595. Autoscrolling of layers didn't really work at all unless the layer was coincidentally
in the root layer's coordinate space. The event point was an absolute position within the document, but
the layer's rect was only local coords. This patch makes sure to use absolute bounds for the layer
when comparing it with the point.
This is covered by the scrollRevealButton test case already in the tree... the results change to be more
correct.
Reviewed by ggaren
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
2007-01-11 Brady Eidson <beidson@apple.com> 2007-01-11 Brady Eidson <beidson@apple.com>
Reviewed by Oliver Reviewed by Oliver
......
...@@ -732,13 +732,15 @@ void RenderLayer::scrollRectToVisible(const IntRect &rect, const ScrollAlignment ...@@ -732,13 +732,15 @@ void RenderLayer::scrollRectToVisible(const IntRect &rect, const ScrollAlignment
int xOffset = 0, yOffset = 0; int xOffset = 0, yOffset = 0;
if (m_object->hasOverflowClip()) { if (m_object->hasOverflowClip()) {
IntRect layerBounds = IntRect(xPos() + scrollXOffset(), yPos() + scrollYOffset(), int x, y;
m_object->absolutePosition(x, y);
IntRect layerBounds = IntRect(x + scrollXOffset(), y + scrollYOffset(),
width() - verticalScrollbarWidth(), height() - horizontalScrollbarHeight()); width() - verticalScrollbarWidth(), height() - horizontalScrollbarHeight());
IntRect exposeRect = IntRect(rect.x() + scrollXOffset(), rect.y() + scrollYOffset(), rect.width(), rect.height()); IntRect exposeRect = IntRect(rect.x() + scrollXOffset(), rect.y() + scrollYOffset(), rect.width(), rect.height());
IntRect r = getRectToExpose(layerBounds, exposeRect, alignX, alignY); IntRect r = getRectToExpose(layerBounds, exposeRect, alignX, alignY);
xOffset = r.x() - xPos(); xOffset = r.x() - x;
yOffset = r.y() - yPos(); yOffset = r.y() - y;
// Adjust offsets if they're outside of the allowable range. // Adjust offsets if they're outside of the allowable range.
xOffset = max(0, min(scrollWidth() - width(), xOffset)); xOffset = max(0, min(scrollWidth() - width(), xOffset));
yOffset = max(0, min(scrollHeight() - height(), yOffset)); yOffset = max(0, min(scrollHeight() - height(), yOffset));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment