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-overflow] Scrollable overflow region: need clarification about what box is scrollable padding vs content #1232

Closed
atotic opened this issue Apr 17, 2017 · 3 comments

Comments

@atotic
Copy link
Contributor

atotic commented Apr 17, 2017

I am reimplementing overflow in Chrome, and need clarification of size of scrollable overflow region.

The issue I am concerned was mentioned in css-overflow-3

There’s disagreement on the scrolling model. 2.1 apparently defined that you scrolled the content area; the content would overflow the content-box, and you would union that overflow with the content box to find the scrollable area. In particular, this means that the content would be offset by the start-sides padding, but if it overflowed, it would go right to the edge on the end sides. This is what Firefox and IE do.
At least some authors (and spec authors) instead have the mental model that the padding box is what’s scrollable, so when you scroll to the end of the overflow, there’s the right/bottom padding. Chrome/WebKit do this for the block axis, at least. They’re somewhat inconsistent for the inline axis; there’s something weird about how they handle lineboxes.

It seems that the block-axis padding is probably web-compatible to honor. It’s unclear that the inline-axis padding will be. Further experimentation is needed.

In css-overflow-4 this issue is not addressed directly. From reading the spec, my best guess is that content area is scrollable, and not the padding area.

Is my reading of the spec correct?

Example:

.container {
  width: 100px;
  height: 100px;
  padding: 30px;
  overflow: scroll;
}
.target {
  width: 200px;
  heigth: 200px;
}

<div class="container">
  <div class="target"></div>
</div>

In this example, according to the spec:
.container.scrollHeight = .container.paddingTop + .target.height
.container.scrollWidth = .container.paddingLeft + target.width

.container.paddingRight & .container.paddingBottom are not used to compute scroll height.

Existing browsers: do they use padding to compute scrollable overflow?

Chrome: bottom yes, right no
Safari: bottom yes, right no
Firefox: bottom no, right no
Edge: bottom no, right no
IE: bottom yes, right yes

@fantasai fantasai added the css-overflow-3 Current Work label Apr 18, 2017
@fantasai
Copy link
Collaborator

fantasai commented Apr 18, 2017

css-overflow-4 is mostly about experimental fragmentation stuff. css-overflow-3 is needing some reverse-engineering work to spec correctly. Basically, there is no reliable spec for this yet, so please don't expect the spec to be correct and report anything that seems wrong. :)

@fantasai fantasai reopened this Apr 18, 2017
@fantasai
Copy link
Collaborator

fantasai commented Mar 6, 2018

@atotic Is this a duplicate of #129 or is it subtly different somehow?

@frivoal
Copy link
Collaborator

frivoal commented Apr 6, 2018

I cannot tell the difference with #129 either. Closing. Please reopen if it was actually about something else.

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

No branches or pull requests

3 participants