Fix scrolling to anchor on load
It looks like between when I reverted my patch in https://crrev.com/777040 and when I originally landed it there's been some changes that meant my revert broke hash navigation. I'm not sure how this worked before but it looks like currently the navigation relies on the fact that at the end of a frame's layout, we called into RootScrollerController::DidUpdateLayout which would recalculate the root scroller and then synchronously recompute style and layout using Document::UpdateStyleAndLayout(). When a page is finished parsing it tries to scroll to the hash in FrameLoader::FinishedParsing. However, if the page is blocked from rendering this will be deferred since we can't layout yet. Normally, when the load event is fired, we'd call Document::ImplicitClose which calls LocalFrameView::UpdateLayout. This causes the scroll to the hash via the above indirect call to Document::UpdateStyleAndLayout but my revert above removed this call. This CL fixes the issue by directly trying to scroll to the hash in ImplicitClose. Bug: 788486 Change-Id: I67f78372380f043bf88fda036bf7c263b17fbca0 Reviewed-on: https://chromium-review.googlesource.com/809093 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by:Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/master@{#524483}
Showing
Please register or sign in to comment