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-contain] The interaction between containment on the HTML element, and overflow propagation is insufficiently specified #7184

Closed
smfr opened this issue Mar 30, 2022 · 1 comment
Labels
Closed Accepted as Editorial css-overflow-3 Current Work Testing Unnecessary Memory aid - issue doesn't require tests

Comments

@smfr
Copy link
Contributor

smfr commented Mar 30, 2022

The note at https://www.w3.org/TR/css-overflow-3/#overflow-propagation says "Using containment disables this special handling of the HTML body element."

However, it doesn't say which element containment is being applied to in this scenario; it might be the body or the html.

So the behavior of this scenario isn't very clear:

html { contain: layout; }
body { overflow: hidden; }

Does overflow:hidden propagation from the body to the viewport, or does containment on the html prevent that propagation?

Test case at https://jsfiddle.net/qj9v0h2t/

webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this issue Mar 31, 2022
…ody element for overflow viewport propagation [part2]

https://bugs.webkit.org/show_bug.cgi?id=238572

Reviewed by Simon Fraser.

Source/WebCore:

While neither the overflow(1) nor the css containment(2) specs are explicit about disabling the propagation of non-visible overflow to the viewport
when the <html> has containment, this behavior makes sense (and also see w3c/csswg-drafts#7184).

(1) https://www.w3.org/TR/css-overflow-3/#overflow-propagation
(2) https://www.w3.org/TR/css-contain-1/#contain-property

* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateFromStyle):

LayoutTests:

* TestExpectations: Progressions.



Canonical link: https://commits.webkit.org/249064@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@292157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@frivoal frivoal added the css-overflow-3 Current Work label Aug 4, 2022
@frivoal
Copy link
Collaborator

frivoal commented Aug 4, 2022

It needs republishing, but css-contain-1 gives details at https://drafts.csswg.org/css-contain-1/#c3

Additionally, when the used value of the contain property on either the HTML html or body elements is anything other than none, propagation of properties from the body element to the initial containing block, the viewport, or the canvas background, is disabled. Notably, this affects:

Note: Propagation to the initial containing block, the viewport, or the canvas background, of properties set on the html element itself is unaffected.

css-overflow-3, on the other hand, could be clearer.

@frivoal frivoal closed this as completed in d67df22 Aug 4, 2022
@frivoal frivoal added Closed Accepted as Editorial Testing Unnecessary Memory aid - issue doesn't require tests and removed css-contain-1 labels Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Editorial css-overflow-3 Current Work Testing Unnecessary Memory aid - issue doesn't require tests
Projects
None yet
Development

No branches or pull requests

2 participants