Skip to content
Permalink
Browse files
Use logical top/bottom/height when computing available height for out…
… of flow block.

https://bugs.webkit.org/show_bug.cgi?id=243689
rdar://98340232

Reviewed by Alan Bujtas.

This resolves a stale FIXME when determining whether to compute the height
of an out of flow positioned block. Before, we were using top, bottom, and height
when we should use the logical versions of these to correctly return the available
height to children when writing-mode is vertical. This resolves two WPT failures
in css-sizing.

* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::availableLogicalHeightUsing const):
* LayoutTests/TestExpectations:

Canonical link: https://commits.webkit.org/253312@main
  • Loading branch information
rreno authored and alanbaradlay committed Aug 10, 2022
1 parent c691e65 commit b5a5bcd690b48a03cb548873ddc02f054c5fbaf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
@@ -4727,12 +4727,10 @@ webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/contain-intri
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-logical-001.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-logical-002.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/image-fractional-height-with-wide-aspect-ratio.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-008.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-002.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-003.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-004.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-006.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-008.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-009.html [ ImageOnlyFailure ]
webkit.org/b/214463 imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-replaced-dynamic-010.html [ ImageOnlyFailure ]

@@ -3715,9 +3715,9 @@ LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogi
if (std::optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h, std::nullopt))
return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());

// FIXME: Check logicalTop/logicalBottom here to correctly handle vertical writing-mode.
// https://bugs.webkit.org/show_bug.cgi?id=46500
if (is<RenderBlock>(*this) && isOutOfFlowPositioned() && style().height().isAuto() && !(style().top().isAuto() || style().bottom().isAuto())) {
// Height of absolutely positioned, non-replaced elements section 5.3 rule 5
// https://www.w3.org/TR/css-position-3/#abs-non-replaced-height
if (is<RenderBlock>(*this) && isOutOfFlowPositioned() && style().logicalHeight().isAuto() && !(style().logicalTop().isAuto() || style().logicalBottom().isAuto())) {
RenderBlock& block = const_cast<RenderBlock&>(downcast<RenderBlock>(*this));
auto computedValues = block.computeLogicalHeight(block.logicalHeight(), 0);
return computedValues.m_extent - block.borderAndPaddingLogicalHeight() - block.scrollbarLogicalHeight();

0 comments on commit b5a5bcd

Please sign in to comment.