[popover][anchor-position] Implement implicit anchoring (2/2) #37129
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the 2/2 patch implementing implicit anchoring for popovers,
focusing on layout-level changes.
With the info of which elements are used as implicit anchors, this
patch adds the implicit anchors into NG*AnchorQuery with LayoutObject
as keys, so that implicit anchor queries can be evaluated without an
anchor name.
At a more detailed level, now all the NG*AnchorQuery classes need to
maintain two hashmaps: one keyed by names for the named anchors, and
the other keyed by LayoutObjects for the implicit anchors. To reduce
code verbosity, the common structure of these classes is abstracted
into a base class NGAnchorQueryBase.
Bug: 1307772, 1380112
Change-Id: I9bdec5e3c08f9b9b20442503dedf32995643f037
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4053342
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1078270}