Skip to content
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

[css-align][css-overflow] Specify treatment of border-box padding for text input elements #1717

Closed
boazsender opened this issue Aug 10, 2017 · 8 comments
Labels

Comments

@boazsender
Copy link

@alijuma, @Hexcles and I are working to squash an old compatibility issue over on whatwg/compat#81 where firefox clips input text and chrome, safari and edge don't.

Section 3.1 of css-ui comes close to specifying this behavior but does not (thanks for pointing that out @alijuma): https://drafts.csswg.org/css-ui-3/#valdef-box-sizing-border-box

What do we think of adding language to this section to specify border-box text/padding interaction. Per our conversation on the other issue, I would suggest that the correct behavior is not to clip the text when the input height minus the input padding minus the input border is smaller than the height of the text. In other words, when the padding is too large, ignore it, or paint it behind the text.

Here's what the compat issue looks like:
ff-chrome-txt-height

CC @dbaron, @bzbarsky, @tabatkins, @frivoal

@bzbarsky
Copy link

The basic question is what the scrollable area is here. Is the padding inside the scrollable area, or outside?

The actual behavior of at least Chrome is rather inconsistent here. For example, horizontal padding is not included in the scrollable area, but vertical padding is. In particular, the "chrome paints text over padding, and firefox paints padding over text" summary in whatwg/compat#81 is wrong as a blanket statement. See https://bugzilla.mozilla.org/show_bug.cgi?id=752790#c7

boazsender added a commit to boazsender/web-platform-tests that referenced this issue Aug 10, 2017
boazsender added a commit to boazsender/web-platform-tests that referenced this issue Aug 10, 2017
boazsender added a commit to boazsender/web-platform-tests that referenced this issue Aug 10, 2017
@fantasai fantasai added css-ui-3 css-ui-4 Current Work labels Aug 15, 2017
@frivoal
Copy link
Collaborator

frivoal commented Aug 18, 2017

I don't think this has much to do with css-ui or box-sizing: border-box, since there is no actual interop problem in terms of sizing, with all browsers giving the same sizes to the content/padding/border areas for both the <input> and the <div>.

This is either an overflow and/or an alignment problem. Retriaging accordingly.

@frivoal frivoal added css-align-3 Current Work css-align-4 css-overflow-3 Current Work and removed css-ui-3 css-ui-4 Current Work labels Aug 18, 2017
@frivoal frivoal changed the title [css-ui] Specify treatment of border-box padding for text input elements [css-align][css-overflow] Specify treatment of border-box padding for text input elements Aug 18, 2017
@frivoal
Copy link
Collaborator

frivoal commented Aug 18, 2017

with all browsers giving the same sizes to the content/padding/border areas for both the <input> and the <div>.

Btw, this can be observed (at least) using dev tools.

@bzbarsky
Copy link

with all browsers giving the same sizes to the content/padding/border areas

That's unclear. The "padding" that browsers claim in their devtools doesn't actually behave like padding is defined to in CSS.

boazsender added a commit to boazsender/web-platform-tests that referenced this issue Nov 6, 2017
boazsender added a commit to boazsender/web-platform-tests that referenced this issue Nov 6, 2017
@boazsender
Copy link
Author

Thanks for pointing me to css-overflow @frivoal. I'm submitting a ref test in css/css-overflow-3 to WPT per this issue that tests for the behavior of safari/chrome/edge (preserving text vertically).

I'm still not sure what the relevant spec change is and am looking for help on that.

@yachiehwu-zz
Copy link

yachiehwu-zz commented Nov 7, 2017

#1941 might be a duplicate of this.
I have done some browsers test and summarized the browser behaviors on #1941.
A quick say is that there are three different behaviors among Firefox, Chrome, Safari, Edge, in the vertical direction.
I also bring up a proposal to try to find a solution for this on #1941.

@karlcow
Copy link
Member

karlcow commented Nov 14, 2017

@frivoal @boazsender It doesn't seem to be an issue with overflow either. Changing the overflow value doesn't change the behavior of the text in Chrome and Safari for this specific case. @yachiehwu documented this clearly in #1941 and in https://bugzilla.mozilla.org/show_bug.cgi?id=752790#c29

@boazsender
Copy link
Author

I'm closing this in favor of #1941 which lays out a more cogent proposal for a spec change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants