[webkit-changes] [WebKit/WebKit] 78a954: Overflow should establish an independent formattin...
Sammy Gill
noreply at github.com
Wed Jan 17 11:08:41 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 78a954e5a2bd3f1acacb08e8fd5c370809ea4fe7
https://github.com/WebKit/WebKit/commit/78a954e5a2bd3f1acacb08e8fd5c370809ea4fe7
Author: Sammy Gill <sammy.gill at apple.com>
Date: 2024-01-17 (Wed, 17 Jan 2024)
Changed paths:
A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/overflow-hidden-does-not-prohibit-subgrid-expected.html
A LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/overflow-hidden-does-not-prohibit-subgrid.html
M Source/WebCore/rendering/RenderBox.h
M Source/WebCore/rendering/RenderBoxInlines.h
M Source/WebCore/rendering/RenderElement.cpp
M Source/WebCore/rendering/RenderObject.cpp
M Source/WebCore/rendering/RenderObject.h
M Source/WebCore/rendering/RenderObjectInlines.h
Log Message:
-----------
Overflow should establish an independent formatting context on only block boxes.
https://bugs.webkit.org/show_bug.cgi?id=267085
rdar://problem/120848131
Reviewed by Tim Nguyen.
css-overflow-3 states: If the computed value of overflow on a block box
is neither visible nor clip nor a combination thereof, it establishes
an independent formatting context for its contents.
https://drafts.csswg.org/css-overflow-3/#overflow-control
This means other types of boxes (e.g. grid items or flex items)
should not be establshing independent formatting contexts. This is
important in cases such as when a grid item is also a subgrid. If a grid
item which is supposed to be a subgrid establishes an independent
formatting context (e.g. due to layout containment), then the grid item
would not actually be a subgrid. A grid item with certain values of
overflow do not appear to be a case in which this would occur.
Currently establishesIndependentFormattingContext returns true
unconditionally if hasPotentiallyScrollableOverflow() returns true.
Instead, we should make sure this only occurs if the box is a block box
to match the spec.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/overflow-hidden-does-not-prohibit-subgrid-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-grid/subgrid/overflow-hidden-does-not-prohibit-subgrid.html: Added.
* Source/WebCore/rendering/RenderBox.h:
(WebCore::RenderBox::isFlexItem const):
* Source/WebCore/rendering/RenderBoxInlines.h:
(WebCore::RenderBox::intrinsicLogicalHeight const):
(WebCore::RenderBox::isBlockLevelBox const): Deleted.
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::establishesIndependentFormattingContext const):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::isBlockBox const):
* Source/WebCore/rendering/RenderObject.h:
* Source/WebCore/rendering/RenderObjectInlines.h:
(WebCore::RenderObject::isBlockLevelBox const):
Canonical link: https://commits.webkit.org/273134@main
More information about the webkit-changes
mailing list