Fix nullptr when calling GetPositionAnchor(Element|Object)
anchor_query can be nullptr if no descendants of the current
containing block have anchor-name. Problem happens when the current
OOF LayoutObject has position-try but it doesn't have anchor position
(causing the UBSan warning about *anchor_query but the nullptr was
never actually dereferenced), or it has an invalid position-anchor
(causing nullptr crash).
Bug: 338929745
Change-Id: I488fba3aeaf7efdaef2bf75e8cc65fa97240af1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5564844
Auto-Submit: Xianzhu Wang wangxianzhu@chromium.org
Commit-Queue: Mason Freed masonf@chromium.org
Reviewed-by: Mason Freed masonf@chromium.org
Cr-Commit-Position: refs/heads/main@{#1305353}