WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
283295
[css-anchor-position-1] Fix evaluation of default anchor elements
https://bugs.webkit.org/show_bug.cgi?id=283295
Summary
[css-anchor-position-1] Fix evaluation of default anchor elements
Pawel Lampe
Reported
2024-11-18 04:01:33 PST
While working on anchor-center I've discovered that in some cases the resolution of anchoring is not done and therefore the anchored elements are not being linked to anchors. In other words, in some cases it's impossible to fetch default anchor element (
https://drafts.csswg.org/css-anchor-position-1/#default-anchor-element
) of given element. Example 1: In case of
https://github.com/web-platform-tests/wpt/blob/master/css/css-anchor-position/anchor-center-offset-change.html
the position-anchor is set to --anchor (that is a valid anchor) and the left is set to anchor(--unknown right, 0px) - in this case the anchor resolution should succeed and the internal anchoring-related data structures should store the relation between anchor and the anchor target. Example 2: In case of
https://github.com/web-platform-tests/wpt/blob/master/css/css-anchor-position/anchor-center-scroll.html
the position-anchor is set to --anchor (that is a valid anchor) and yet no inset properties are using anchor() function. In this case the anchor resolution should still succeed and the internal anchoring-related data structures should store the relation between anchor and the anchor target.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-11-18 08:35:10 PST
<
rdar://problem/140124449
>
Kiet Ho
Comment 2
2025-01-13 02:15:18 PST
I haven't dived into this, so some speculation: We gather: * all anchor references - anchor name used in anchor() or anchor-size(), or elements with anchor-center * all anchors - elements with anchor-name specified. Then we attempt to resolve the anchor references, using the gathered list of anchors. I think the code right now only looks for anchor references in anchor() and anchor-size(). If an element uses anchor-center and not anchor()/anchor-size(), then the reference isn't caught, even though anchor-center refers to the default anchor.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug