[Webkit-unassigned] [Bug 176451] scrollIntoView and scrolling to anchor inside iframe don't scroll content to proper position

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 13 10:40:54 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=176451

Frédéric Wang (:fredw) <fred.wang at free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #333689|0                           |1
        is obsolete|                            |
 Attachment #333694|0                           |1
        is obsolete|                            |

--- Comment #15 from Frédéric Wang (:fredw) <fred.wang at free.fr> ---
Created attachment 333703

  --> https://bugs.webkit.org/attachment.cgi?id=333703&action=review

Patch for testing

The following trace seems relevant:

WebCore::ScrollView::contentsToContainingViewContents(WebCore::IntRect) const
WebCore::RenderLayer::scrollRectToVisible(WebCore::SelectionRevealMode, WebCore::LayoutRect const&, bool, WebCore::ScrollAlignment const&, WebCore::ScrollAlignment const&)
WebCore::RenderLayer::scrollRectToVisible(WebCore::SelectionRevealMode, WebCore::LayoutRect const&, bool, WebCore::ScrollAlignment const&, WebCore::ScrollAlignment const&)
WebCore::RenderObject::scrollRectToVisible(WebCore::SelectionRevealMode, WebCore::LayoutRect const&, bool, WebCore::ScrollAlignment const&, WebCore::ScrollAlignment const&)
WebCore::Element::scrollIntoView(bool)

where contentsToContainingViewContents is called in RenderLayer::scrollRectToVisible here:

if (frameView.safeToPropagateScrollToParent()) {
    ...
    // Convert the rect into the coordinate space of the parent frame's document.
    newRect = frameView.contentsToContainingViewContents(enclosingIntRect(newRect));

For the test case with initial scroll y=200 and target y=2000, the newRect becomes at y=2200, which is then wrongly used for the call to frameView.setScrollPosition.

I'm attaching a hacky patch that fixes the issue for the test cases I attached, as well as the link provided in comment 0. The issue seems similar (using or not using viewToContents/contentsToView to take into account scroll offset) but different from the issue I had in bug 176451.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180213/d19e948a/attachment.html>


More information about the webkit-unassigned mailing list