-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate text fragments with Document lifecycle
This CL is a refactoring to improve how text fragments are integrated with the document lifecycle. There are several high-level changes here: - Annotations (the thing that performs text search and applies the highlights) no longer allow attaching at arbitrary points. Instead, clients can set an annotation as "needing attachment" and schedule a BeginFrame. In the next BeginFrame, all annotations needing attachment perform their search after layout is updated. - Text fragments have a special case for when a page has never been visible; the text search is deferred until the page becomes visible. The above change required moving this behavior into AnnotationAgentContainerImpl. - TextFragmentAnchor is no longer responsible for controlling when annotation attachment occurs. Instead, it's invoked right after annotations are attached and checks the status of its annotations to update its internal state and perform scroll into view and related actions. - Simplify TextFragmentAnchor's state machine by removing the ScriptableActions state. Instead, the script-running actions are scheduled for an animation frame and then move the anchor into the kDone state. See also the related followup which this CL enables: https://crrev.com/c/4586061 Change-Id: I1f6fd7c28b86274beae2cdc934b529c9f7bfb472 Bug: 1327734,1303887,963045 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4577583 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1158968}
- Loading branch information
Showing
24 changed files
with
455 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.