Reland "[text-fragment] Attempt search for dynamic content" Reland note: iframes.sub.html was timing out because it contains several sub-tests, each of which now wait 2s which, in total, exhausted the 6s timeout. Reland marks this test as timeout=long to use the extended timeout. Previously landed CL is first patchset. Text fragments currently perform up to two searches, one when document parsing completes and a second attempt when document load completes (if load wasn't completed at parse complete time). However, pages, often load content after document load, when content is "dynamically loaded". One popular example is Mobile Wikipedia, which adds `hidden=until-found` on collapsed sections in idle tasks after load. This meant text-fragments couldn't target pages like these. This CL attempts to make text fragments work on dynamically loaded pages by performing a third attempt, if needed. If all directives haven't matched at load time, a delayed task is scheduled for 500ms that will request attachment on unmatched directives. TextFragmentAnchor listens for relevant changes in the DOM and reschedules this task each time a change is made. At 3000ms it gives up and performs the search to avoid waiting forever. At a high level, this CL tries to separate the state tracking of actions performed for the first matching directive from the state tracking for running multiple searches. This is done by introducing a new iteration_ enum tracking the latter. Bug: 963045 Change-Id: Ied3f9c610c348eeeca23ace50864f0cc2ff2b233 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4629864 Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Auto-Submit: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/main@{#1160827}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.