-
Notifications
You must be signed in to change notification settings - Fork 716
[css-anchor-position] anchor()
Fallback type inconsistency vs WPT
#10831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The spec seems clear, unless there's a strong cause to allow |
So the fallback is somewhat desirable IMO, e.g. you can chain things together like:
e.g. if "a" doesn't exist, use "b". Note this is different than something like: |
Hm, probably can draw an analogy to |
1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1900232 gecko-commit: a0bc0fe119dd86f4c51d31d2aadfa20133e0f595 gecko-reviewers: firefox-style-system-reviewers, devtools-reviewers, nchevobbe, emilio
…irefox-style-system-reviewers,devtools-reviewers,nchevobbe,emilio 1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535
1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1900232 gecko-commit: a0bc0fe119dd86f4c51d31d2aadfa20133e0f595 gecko-reviewers: firefox-style-system-reviewers, devtools-reviewers, nchevobbe, emilio
…irefox-style-system-reviewers,devtools-reviewers,nchevobbe,emilio 1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535
…irefox-style-system-reviewers,devtools-reviewers,nchevobbe,emilio 1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535 UltraBlame original commit: a0bc0fe119dd86f4c51d31d2aadfa20133e0f595
…irefox-style-system-reviewers,devtools-reviewers,nchevobbe,emilio 1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535 UltraBlame original commit: a0bc0fe119dd86f4c51d31d2aadfa20133e0f595
…irefox-style-system-reviewers,devtools-reviewers,nchevobbe,emilio 1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535 UltraBlame original commit: a0bc0fe119dd86f4c51d31d2aadfa20133e0f595
So
The recursive fallback case will pick the option 1 so long as it's referring to a valid anchor, regardless of the absolute containing block overflowing, where the |
…irefox-style-system-reviewers,devtools-reviewers,nchevobbe,emilio 1. WPT tests now accept `anchor-size()` property for sizing, inset, and margin properties [1]. 2. Adjust test expectations for `anchor-size()` fallbacks containing `anchor-size()` - This will need to be followed up once [2] is resolved. 3. Adjust expectations for devtools' auto-completion related mochitests. 4. We don't yet handle `anchor-size()` in `calc()`. [1] w3c/csswg-drafts#9827 [2] w3c/csswg-drafts#10831 Differential Revision: https://phabricator.services.mozilla.com/D222535
A testcase for my previous comment:
On Chrome Version 134.0.6958.2 (Official Build) dev (64-bit), the first pink element positions to the lower right, where the second one positions directly below the anchor. Both are fallbacks, but |
Apologies for the late response, but as far as I can tell there's no inconsistency here. There's some additional restrictions on validity for the anchor functions, so they can't be used everywhere, but |
The CSS Working Group just discussed
The full IRC log of that discussion<emilio> TabAtkins: in this issue it was raised that there's an inconsistency with the spec that says `<length-percentage>` on the fallback<emilio> ... anchor and anchor-size are both `<length>`s <emilio> ... so type wise they should be valid fallback <emilio> ... so afaict there's no inconsistency <emilio> RESOLVED: Close no change |
Ok - looking for a bit of additional clarification:
I assume "additional restrictions" refer to to #9827 (Properties need to be compatible with interleaving)? EDIT: Reasoning behind this ask is because the spec regarding validity currently seems to imply that "not being used in inset properties of abs-positioned box" is handled the same as "anchor it's referring to is not valid" - that is to say, use fallback if it exists, otherwise Invalid At Computed Value Time. Chrome currently seems to treat failing the first part of the first validity condition as Invalid At Parse Time. OTOH, So hopefully the spec should be clarified on that. Though, I think there's some argument to be had about maybe being more web-compatible to be IACVT for unsupported properties, in case we end up supporting more? |
(Above question is probably better answered in #10950) |
For the
anchor()
function's optional fallback value, the spec text specifies<length-percentage>
, but the corresponding WPT,anchor-parse-valid.html
, considers the use ofanchor()
function itself to be valid, seemingly contradicting the spec text.It seems to me that both the spec and the test were initially committed this way - Which one is correct?
The text was updated successfully, but these errors were encountered: