interop
interop copied to clipboard
Unreviewed changes to anchor positioning
Test List
From https://github.com/web-platform-tests/wpt/pull/51509:
https://wpt.fyi/results/css/css-anchor-position/anchor-center-htb-htb.html https://wpt.fyi/results/css/css-anchor-position/anchor-center-htb-vrl.html https://wpt.fyi/results/css/css-anchor-position/anchor-center-vrl-htb.html https://wpt.fyi/results/css/css-anchor-position/anchor-center-vrl-vrl.html https://wpt.fyi/results/css/css-anchor-position/position-area-anchor-outside.html https://wpt.fyi/results/css/css-anchor-position/position-area-anchor-partially-outside.html https://wpt.fyi/results/css/css-anchor-position/position-area-basic.html
cc @fantasai
Rationale
This affected the test results and we should review if there are any surprises. From the PR checks:
- Chrome, 6 tests affected: https://wpt.fyi/results/css/css-anchor-position?diff&filter=ADC&run_id=5417950087741440&run_id=4853157459132416
- Firefox, 4 tests affected: https://wpt.fyi/results/css/css-anchor-position?diff&filter=ADC&run_id=5927742891884544&run_id=5078710804021248
- Safari, 6 tests affected: https://wpt.fyi/results/css/css-anchor-position?diff&filter=ADC&run_id=5172133657575424&run_id=5090170984726528
@bfgeek can you review the changes? @lilles says that you implemented this and wrote the tests.
Hmm... the changes to anchor-center-* seem incorrect?
-
anchor-center coerce any
autoinset properties to zero. https://drafts.csswg.org/css-anchor-position-1/#valdef-justify-self-anchor-center -
Then the overflow treatment should be that it is shifted to remain within its original containing-block (not its inset modified containing-block) https://drafts.csswg.org/css-anchor-position-1/#valdef-justify-self-anchor-center:~:text=in%20order%20to%20remain%20within%20the%20original%20containing%20block
E.g. the IMCB is [0, 20], the CB is [0, 0]. The size is calculated based off the IMCB to be 80. The anchor-center is at 65. Its original position is [25, -5] (overflow the original CB of 5 to the right), then adjusted to be within the original CB of [0, 0], to a final position of [20, 0].
@tabatkins Is my understanding correct?
My interpretation was that the box is only allowed to overflow the IMCB if it doesn't fit within the IMCB. In this case, the box fits within the IMCB, so it should remain within it. https://www.w3.org/TR/css-align-3/#auto-safety-position
The anchor-center value is a bit weird in that its requested alignment is not necessarily within the IMCB even in the case of a box that's smaller than the IMCB. But if the author gave inset values that constrain its position, I think we should be honoring them.
We probably need to open a CSSWG issue on this.
@bfgeek Can we close this issue given the CSSWG resolution?
@bfgeek Can we close this issue given the CSSWG resolution?
The tests are likely going to need further refinement/changes, as the CSSWG resolution adds more safety on top of whats there. But ok for the moment.
Feel free to land tweaks as you feel appropriate as long as they match the spec. We can file another interop issue if there is a disagreement. I'll close this one for now.