-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Don't clip range/checkbox/radio overflow to border box. #10025
Conversation
We might want to give the same treatment to checkbox/radio... People use |
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1872006 gecko-commit: d854806633ea82ac653a4798573a64ee16b8483e gecko-reviewers: dholbert
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327
@emilio I wonder if the styles should be applied on |
@nt1m, can you elaborate on why? File inputs at least also clip overflow (and can generate overflow otherwise) cross-browser. Text-like inputs do also clip overflow, and due to text being the fallback type, it's non-trivial to define that via CSS (probably need to use revert). So IIUC that leaves checkbox/radio/image/range left which don't need / have this special clipping behavior, right? Also the spec used to say "anything but image". So not opposed I guess, if you have a better way to specify this, but |
That is, from my perspective, the most we can get to explain replaced-ish controls like "(inline-)block + overflow: clip, with unspecified stuff inside", the better. |
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1872006 gecko-commit: d854806633ea82ac653a4798573a64ee16b8483e gecko-reviewers: dholbert
This is not compatible since appearance: none can make these elements create overflow in a way such that engines honor the overflow property. These also don't create any overflow unless they are appearance: none, so they don't need the magic clip prose anyways. Fixes whatwg#10024.
7c191a7
to
066e491
Compare
#10025 (comment) was indeed a real issue, see https://bugzilla.mozilla.org/show_bug.cgi?id=1872509, so I've updated the PR accordingly. |
Since it's not web-compatible. I had already brought this possibility up in the comments of whatwg/html#10025, so will update that PR accordingly. Remove forceful overflow: hidden for file / date inputs, which was caught by the tests in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D197456
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327 UltraBlame original commit: d854806633ea82ac653a4798573a64ee16b8483e
Since it's not web-compatible. I had already brought this possibility up in the comments of whatwg/html#10025, so will update that PR accordingly. Remove forceful overflow: hidden for file / date inputs, which was caught by the tests in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D197456 UltraBlame original commit: 30b0d1ecdc26a3e4753bef7807739106282ed827
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327 UltraBlame original commit: d854806633ea82ac653a4798573a64ee16b8483e
Since it's not web-compatible. I had already brought this possibility up in the comments of whatwg/html#10025, so will update that PR accordingly. Remove forceful overflow: hidden for file / date inputs, which was caught by the tests in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D197456 UltraBlame original commit: 30b0d1ecdc26a3e4753bef7807739106282ed827
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327 UltraBlame original commit: d854806633ea82ac653a4798573a64ee16b8483e
Since it's not web-compatible. I had already brought this possibility up in the comments of whatwg/html#10025, so will update that PR accordingly. Remove forceful overflow: hidden for file / date inputs, which was caught by the tests in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D197456 UltraBlame original commit: 30b0d1ecdc26a3e4753bef7807739106282ed827
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327
Since it's not web-compatible. I had already brought this possibility up in the comments of whatwg/html#10025, so will update that PR accordingly. Remove forceful overflow: hidden for file / date inputs, which was caught by the tests in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D197456
@@ -131683,7 +131683,7 @@ input, select, button, textarea { | |||
appearance: auto; | |||
} | |||
|
|||
input:not([type=image i]) { | |||
input:not([type=image i], [type=range i], [type=checkbox i], [type=radio i]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, assuming your compat analysis shows that this is web compatible.
@emilio |
cc @pxlcoder |
That doesn't match the spec either before or after my change tho, right? Gecko has always clipped file inputs, and forcefully since https://bugzilla.mozilla.org/show_bug.cgi?id=1543477 (to match Chromium and the spec). |
I think with respect to #9994 that's true, but the claim above about it happening across browsers is not. And as you are now suggesting normative changes I do think it warrants consideration. |
Yeah, I think I mis-tested Webkit, thanks for pointing that out. However I think this is still a progression (and the change proposed doesn't change behavior wrt file inputs in particular, fwiw). |
Tests in https://phabricator.services.mozilla.com/D197457 cover all input types, fwiw. Other than that, I agree. I think barring any further compat issues (which are, IMO, unlikely) this is a much better state to be in than pre - #9994, and is a step to have beter interop here. |
If we do this as-is and thus agree clipping is preferred, #9546 (switch) will need to add |
You mean set In general I don't think "clipping is preferred" is correct. Just "clipping is the long-standing interoperable behavior for most input types, and this defines it in a way that integrates correctly with other CSS features, instead of magic prose". |
It also happens to be the case that a negation is the easiest (only?) way to target text inputs with the rule, given the "random input type falls back to text" behavior. |
I discussed this with @pxlcoder and we're okay with going in this direction. We haven't fully evaluated yet if this is possible for all controls, but making incremental progress is okay with us. Does that work? If so, I can merge this. |
That sounds good. I'll push the tests then. Thanks Anne! |
Hmm, I was about to merge this, but upon rereading
strikes me as incorrect for WebKit on macOS which does have its own minimal sizes for controls for painting purposes. Would that still require magic clip prose then? |
Not really right? My understanding is that you're not clipping it, so this would preserve your current behaviour. |
Ah right, but I should remove the remark as they can cause overflow in some implementations for appearance:auto. |
HTML spec issue / PR: whatwg/html#10025 Differential Revision: https://phabricator.services.mozilla.com/D197327 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1872006 gecko-commit: d854806633ea82ac653a4798573a64ee16b8483e gecko-reviewers: dholbert
This fixes #10024.
At least two implementers are interested (and none opposed):
Tests are written and can be reviewed and commented upon at:
Implementation bugs are filed:
MDN issue is filed: …
The top of this comment includes a clear commit message to use.
(See WHATWG Working Mode: Changes for more details.)
/rendering.html ( diff )