[anchor] Respect anchor-scope in PhysicalAnchorQuery::AnchorReference
The scroll-snapshotting code uses PhysicalAnchorQuery::AnchorReference
(via LayoutBox::FindTargetAnchor) in order to find the relevant
anchor element. This traversal also needs to check whether a candidate
anchor and querying element is in the same (anchor) scope.
This fixes an issue where scroll transforms would not apply
to anchored elements under some scope.
Fixed: 380234225
Change-Id: If778f3c52276c13e9a0b7f0b364ad71266e3da51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6054228
Reviewed-by: Rune Lillesveen futhark@chromium.org
Commit-Queue: Anders Hartvoll Ruud andruud@chromium.org
Cr-Commit-Position: refs/heads/main@{#1389656}