Fix fragment anchor invoked without layout in iframe
In https://crrev.com/45236fd563e9df53dc45579be1f3d0b4784885a2 I did a heavy refactoring of how fragment anchors work and when they get invoked. This refactoring removed the layout call from LocalFrameView::ProcessUrlFragment. This is desirable since it should be layout that drives the fragment anchor, not the other way around. In general avoiding surprise layouts is good. I assumed this would be ok since we'll invoke the fragment anchor again in the next layout. However, there's a case where this isn't true. When a document finishes loading (Document::ImplicitClose) it will invoke the fragment anchor. The fragment anchor will then be removed since the document is already in the "load completed" state. If the iframe finishes loading without any layouts this call will be the only invocation and it'll happen on a dirty layout tree. The solution in this CL is to remove that invocation in ImplicitClose while layout is dirty potentially dirty. If layout is dirty it'll be invoked when we perform the layout. This leaves the only two ways for the anchor to be invoked as: - Right after a layout - When the fragment is first set and layout is already clean Change-Id: I3f038a4e35038a0cd9e4a17593b9b6b3d810068f Bug: 934405 Reviewed-on: https://chromium-review.googlesource.com/c/1481054 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by:Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#636548}
Showing
Please register or sign in to comment