[anchor-position] Make `anchor` attribute work for non-popovers
This patch reimplements how we mark elements that are implicit anchors. Previously it was only marked for popover element's implicit anchors, and now it works for all implicit anchors. This is done by a new class AnchorElementObserver that observes all possible changes in implicit anchor and replaces the old PopoverAnchorObserver. This patch also reveals two existing issues: 1. Element::GetElementAttribute() may return non-null result even if the element is out of tree scope. As fixing the bug is out of the scope here, this patch just works around it. crbug.com/1425215 was filed. 2. popover-anchor-idl-property.html has some bugs that made it pass previously. This patch fixes those bugs. Fixed: 1417346 Change-Id: I798977ab1ed7df0c528b7eb98c64fc04476e6106 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4338487 Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by:Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#1118933}
Loading