Skip to content

Commit

Permalink
REGRESSION (270277@main): [iOS] imported/w3c/web-platform-tests/css/c…
Browse files Browse the repository at this point in the history
…ss-writing-modes/forms/text-input-block-size.optional.html is a constant failure

https://bugs.webkit.org/show_bug.cgi?id=264315
rdar://118035123

Reviewed by Megan Gardner.

imported/w3c/web-platform-tests/css/css-writing-modes/forms/text-input-block-size.optional.html
tests that the block-size of inputs are equal in vertical and horizontal
writing modes.

270277@main modified the user agent stylesheet to use logical properties to
better support vertical form controls. However,
`RenderTextControl::computeLogicalHeight` is still incorrectly using physical
values for padding, border, and margin. The mix of logical height with physical
padding/border/margin results in an inconsistent block-size depending on the
writing mode.

Fix by using logical properties in `RenderTextControl::computeLogicalHeight`.

* Source/WebCore/rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight const):

Canonical link: https://commits.webkit.org/270322@main
  • Loading branch information
pxlcoder committed Nov 7, 2023
1 parent 559334c commit 5158c32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/WebCore/rendering/RenderTextControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ RenderBox::LogicalExtentComputedValues RenderTextControl::computeLogicalHeight(L
return RenderBox::computeLogicalHeight(LayoutUnit(), LayoutUnit());

if (RenderBox* innerTextBox = innerText->renderBox()) {
LayoutUnit nonContentHeight = innerTextBox->verticalBorderAndPaddingExtent() + innerTextBox->verticalMarginExtent();
LayoutUnit nonContentHeight = innerTextBox->borderAndPaddingLogicalHeight() + innerTextBox->marginLogicalHeight();
logicalHeight = computeControlLogicalHeight(innerTextBox->lineHeight(true, HorizontalLine, PositionOfInteriorLineBoxes), nonContentHeight);

// We are able to have a horizontal scrollbar if the overflow style is scroll, or if its auto and there's no word wrap.
Expand All @@ -112,7 +112,7 @@ RenderBox::LogicalExtentComputedValues RenderTextControl::computeLogicalHeight(L
// before calling computeLogicalHeight to avoid this hack.
cacheIntrinsicContentLogicalHeightForFlexItem(logicalHeight);

logicalHeight += verticalBorderAndPaddingExtent();
logicalHeight += borderAndPaddingLogicalHeight();
}

return RenderBox::computeLogicalHeight(logicalHeight, logicalTop);
Expand Down

0 comments on commit 5158c32

Please sign in to comment.