-
Notifications
You must be signed in to change notification settings - Fork 719
[css-position] Behaviour of semi-replaced elements. #6789
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
Well, it would fix it for Safari. ^_^
I suppose I'd find it acceptable to have it shrink-fit in both axises (at least it would be consistent, rather than a new and weird behavior), but every divergence that buttons make from a standard inline-block is unfortunate. |
The CSS Working Group just discussed The full IRC log of that discussion |
Clarifying this: I think we've mostly been arguing for something coherent/sensible, rather than arguing specifically for shrink-to-fit. It just happened to be that shrink-to-fit seemed to be the sensible/spec-mandated behavior, at the time of those earlier discussions; but I don't think we're inherently opposed to stretching behavior. I do want to be sure that we consider other related form controls (e.g. textarea, |
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1740580 as a place to post a testcase with screenshots. Here are screenshots in the three major browser engines: |
Some observations:
So: things are a bit of a mess, though (4) and (5) are the points of agreement. Ideally I'd like to have a coherent and likely-to-be-web-compatible way forward here, and I'm not sure that the proposed change (stretching in both axes) is that, given that there are a handful of button-like elements that no browser stretches in both axes at this point. |
@dholbert - I think your testcase can be slightly improved by adding: .abs { width: auto; height: auto; } radio/checkboxes in Blink have some magic happening where they effectively set: width: 13px !important; height: 13px !important; which is why that behaviour is observed. With those explanations currently Blink stretches in the block-axis, and shrink-to-fit in the inline-axis everywhere - except for (5) - agree that can move to stretching in all axes for those three. (4) - Is clouded by default UA styles I believe. The results of above makes me think that'd it be safest to move to a shrink-to-fit behaviour in both axes (except for fieldset, label, output). |
Thanks. Here's a variant of my earlier testcase, now with explicit This change doesn't change the outcome much, though. The only rendering differences from this change:
|
I think I'm still neutral as to which is the best way forward here. Argument in favor of stretching all of these elements (aside from checkbox/radio):
Argument in favor of shrinking all of these elements (aside from output/label/fieldset):
So, from a position of maximal paranoia, it's conceivable that there'd be more webcompat fallout from changing to shrink-to-fit for |
All of which is to say: it feels like stretching would probably be the safest change here (from a webcompat perspective). |
I'd be fine w/ that. |
The CSS Working Group just discussed
The full IRC log of that discussion |
Opps - should probably have mentioned that we'll likely need to leave checkbox & radio buttons alone for the moment. But all browsers are currently consistent there. (and all likely apply an equivalent of a !important width/height property). |
Right, those are the exception to this stretching. (Minor correction: they don't seem to do this via something along the line of |
Does https://html.spec.whatwg.org/multipage/rendering.html#button-layout need changes? (This section should probably be moved to some CSS spec, but not sure where.) |
As per: w3c/csswg-drafts#6789 Removes the tests which were previously testing the shrink-to-fit behaviour, and adds new tests for the stretch behaviour (on more elements). Bug: 1274898 Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb
As per: w3c/csswg-drafts#6789 Removes the tests which were previously testing the shrink-to-fit behaviour, and adds new tests for the stretch behaviour (on more elements). Bug: 1274898 Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb
As per: w3c/csswg-drafts#6789 Removes the tests which were previously testing the shrink-to-fit behaviour, and adds new tests for the stretch behaviour (on more elements). Bug: 1274898 Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272378 Commit-Queue: Ian KilpatrickReviewed-by: Morten Stenshorne Cr-Commit-Position: refs/heads/main@{#946530}
As per: w3c/csswg-drafts#6789 Removes the tests which were previously testing the shrink-to-fit behaviour, and adds new tests for the stretch behaviour (on more elements). Bug: 1274898 Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272378 Commit-Queue: Ian KilpatrickReviewed-by: Morten Stenshorne Cr-Commit-Position: refs/heads/main@{#946530}
As per: w3c/csswg-drafts#6789 Removes the tests which were previously testing the shrink-to-fit behaviour, and adds new tests for the stretch behaviour (on more elements). Bug: 1274898 Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272378 Commit-Queue: Ian KilpatrickReviewed-by: Morten Stenshorne Cr-Commit-Position: refs/heads/main@{#946530}
…when OOF in inline direction., a=testonly Automatic update from web-platform-tests [layout] Stretch semi-replaced elements when OOF in inline direction. As per: w3c/csswg-drafts#6789 Removes the tests which were previously testing the shrink-to-fit behaviour, and adds new tests for the stretch behaviour (on more elements). Bug: 1274898 Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272378 Commit-Queue: Ian KilpatrickReviewed-by: Morten Stenshorne Cr-Commit-Position: refs/heads/main@{#946530} -- wpt-commits: 5bf9341f0881529d809045b71ba7ae887d8919a8 wpt-pr: 31786
…when OOF in inline direction., a=testonly Automatic update from web-platform-tests [layout] Stretch semi-replaced elements when OOF in inline direction. As per: w3c/csswg-drafts#6789 Removes the tests which were previously testing the shrink-to-fit behaviour, and adds new tests for the stretch behaviour (on more elements). Bug: 1274898 Change-Id: I5c40a4b88fe06d7ef79113a66ef3976375d026eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3272378 Commit-Queue: Ian KilpatrickReviewed-by: Morten Stenshorne Cr-Commit-Position: refs/heads/main@{#946530} -- wpt-commits: 5bf9341f0881529d809045b71ba7ae887d8919a8 wpt-pr: 31786
I don't beleive this section needs immediate change. The button element is under "widgets" now - so pretty clear it isn't replaced, (and no mention of semi-replaced in that document). The change decided here makes it so there isn't any special behaviour for these widget elements. |
We should adapt dholbert's test case into a reftest for this issue. |
I posted another testcase on the bug which is a slightly better reftest than the previous ones, and has a reference: Chrome almost matches the expectations here but they seem to have a subtle bug with one form control -- |
(I filed https://bugs.chromium.org/p/chromium/issues/detail?id=1405560 for the Chromium mismatch that I noted. for |
Reopening to double-check the behavior around input type=image |
From: #6580 (comment)
By @tabatkins
Doing this breaks this particular WPT test:
https://wpt.fyi/results/html/rendering/widgets/button-layout/abspos.html
This was added in:
web-platform-tests/wpt#14824
By @zcorpan , (primarily reviewed by @emilio )
whatwg/html#4143
whatwg/html#2948 (by @dholbert )
whatwg/html#4081 (comment)
etc.
Currently we (Blink) have different behaviour in the inline/block axis which we were about to fix (with zero insets, should still shrink-fit, instead of stretch).
The text was updated successfully, but these errors were encountered: