Skip to content

[css-overflow] Clarify the contribution of untransformed direct descendant box #12113

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

Open
stevennovaryo opened this issue Apr 23, 2025 · 1 comment
Labels
css-overflow-3 Current Work

Comments

@stevennovaryo
Copy link

The current implementations of scrollable overflow seems to be quite quirky and specific in terms of direct descendant contribution. Where it would consider the untransformed box of direct descendant, As shown in this example. With the untransformed box of non-direct descendant being omitted, shown by this example. Meanwhile, the scrollable overflow implementations is ignoring the untransformed box in case the box is absolute positioned while the parent element established absolute positioned containing block, shown here.

This quite particular behavior however, is not specifically defined or mentioned in scrollable overflow definition. I believe it would be good to have a consistent behavior for this case, maybe omitting the untransformed box since scrollable overflow are supposed to show till the farthest corner of descendant anyway. Or, an additional explanation for these behavior.

cc: @xiaochengh @Loirooriol

@Loirooriol Loirooriol added the css-overflow-3 Current Work label Apr 29, 2025
@Loirooriol
Copy link
Contributor

I don't trust jsfiddle to keep hosting the examples

Example 1
.container {
  width: 150px;
  height: 150px;
  overflow: scroll;
  background: silver;
  border: solid thick;
}

.element {
  width: 200px;
  height: 200px;
  background: lime;
}

.element-2 {
  width: 100px;
  height: 100px;
}
  <div class="container">
    <div style="transform: translate(-50%, -50%);" class="element">
    </div>
  </div>
Example 2
.container {
  width: 150px;
  height: 150px;
  overflow: scroll;
  background: silver;
  border: solid thick;
}

.element {
  width: 200px;
  height: 200px;
  background: lime;
}

.element-2 {
  width: 100px;
  height: 100px;
}
<div class="container">
  <div style="width: 150px; height: 150px;">
    <div style="transform: translate(-50%, -50%);" class="element">
    </div>
  </div>
</div>
Example 3
.container {
  width: 150px;
  height: 150px;
  overflow: scroll;
  background: silver;
  border: solid thick;
}

.element {
  width: 200px;
  height: 200px;
  background: lime;
}

.element-2 {
  width: 100px;
  height: 100px;
}
  <div class="container" style="position: relative;">
    <div style="transform: translate(-50%, -50%); position: absolute;" class="element">
    </div>
  </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-overflow-3 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants