Fix text fragment after history.replaceState
Text fragments are allowed only if a text fragment token has been generated during loading. The token is effectively a navigation-time user activation flag. To allow user initiated text fragment navigations during a same document navigation, a token may be generated in DocumentLoader::UpdateForSameDocumentNavigation However, this method is called in a variety of other scenarios, such as calls to history.replaceState or portal navigations. In those cases, we would try to generate a new token, fail, and then clobber an existing token, causing pages like in the linked bug to fail. This CL makes it so that we only replace an existing token if the navigation is a standard navigation. Bug: 1147453 Change-Id: I2bad963884068d2de23833ffce37086fda9a034e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533688Reviewed-by:Nick Burris <nburris@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#827036}
Showing
Please register or sign in to comment