1Percentage max-width on aspect-ratio box resolves against wrong axis in perpendicular writing mode
2https://bugs.webkit.org/show_bug.cgi?id=314554
3
4Reviewed by NOBODY (OOPS!).
5
6We had two functions:
7- computeLogicalWidthFromAspectRatioInternal: height x aspect-ratio, no clamping
8- computeLogicalWidthFromAspectRatio: calls Internal, then clamps with min/max
9
10The "Internal" naming was confusing - callers had to know which one to pick
11based on context. But the split is simple: preferred-width computation never
12wants clamping (min/max is applied later by a shared helper), layout always does.
13
14Remove the split. Keep one function (the unconstrained one) named
15computeLogicalWidthFromAspectRatio(). The two layout callsites now call
16constrainLogicalWidthByMinMax() inline, just like the normal width path already
17does. This also fixes an inconsistency (see test case): the old wrapper used
18containingBlockLogicalWidthForContent() to resolve percentage min/max, but the
19normal path in computeLogicalWidth uses a containerWidthInInlineDirection
20variable that accounts for perpendicular writing modes. The aspect-ratio path
21now uses the same variable.
22
23* Source/WebCore/rendering/RenderBlock.cpp:
24(WebCore::RenderBlock::computePreferredLogicalWidths):
25* Source/WebCore/rendering/RenderBox.cpp:
26(WebCore::RenderBox::computeLogicalWidth):
27(WebCore::RenderBox::computeIntrinsicKeywordLogicalWidths):
28(WebCore::RenderBox::computeOutOfFlowPositionedLogicalWidth):
29(WebCore::RenderBox::computeLogicalWidthFromAspectRatio):
30* Source/WebCore/rendering/RenderBox.h:
31* Source/WebCore/rendering/RenderReplaced.cpp:
32(WebCore::RenderReplaced::computePreferredLogicalWidths):
33* LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008-expected.html: Added.
34* LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008-ref.html: Added.
35* LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-percent-non-replaced-008.html: Added.