Skip to content

Commit

Permalink
[iOS] Take logical-min-height value into account when setting minimum…
Browse files Browse the repository at this point in the history
… platform height on buttons

https://bugs.webkit.org/show_bug.cgi?id=265500
<rdar://118572212>

Reviewed by Aditya Keerthi.

* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustButtonStyle const):

Canonical link: https://commits.webkit.org/271272@main
  • Loading branch information
alanbaradlay committed Nov 29, 2023
1 parent 56d0d7b commit 538824c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions LayoutTests/platform/ios/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -4617,8 +4617,6 @@ webkit.org/b/263471 fast/forms/ios/keydown-in-hidden-contenteditable-with-inputm

webkit.org/b/263396 css3/color/text.html [ Skip ]

webkit.org/b/265053 imported/w3c/web-platform-tests/css/css-sizing/button-min-width.html [ Failure ]

# webkit.org/b/263439 [ iOS ] Several WPTs using wheel actions are timing out after b243272
imported/w3c/web-platform-tests/css/css-overscroll-behavior/overscroll-behavior.html [ Skip ]
imported/w3c/web-platform-tests/css/css-scroll-snap/snap-at-user-scroll-end.html [ Skip ]
Expand Down
9 changes: 7 additions & 2 deletions Source/WebCore/rendering/RenderThemeIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -880,8 +880,13 @@ static void adjustInputElementButtonStyle(RenderStyle& style, const HTMLInputEle
// If no size is specified, ensure the height of the button matches ControlBaseHeight scaled
// with the font size. min-height is used rather than height to avoid clipping the contents of
// the button in cases where the button contains more than one line of text.
if (style.logicalWidth().isIntrinsicOrAuto() || style.logicalHeight().isAuto())
style.setLogicalMinHeight(Length(ControlBaseHeight / ControlBaseFontSize * style.fontDescription().computedSize(), LengthType::Fixed));
if (style.logicalWidth().isIntrinsicOrAuto() || style.logicalHeight().isAuto()) {
auto minimumHeight = ControlBaseHeight / ControlBaseFontSize * style.fontDescription().computedSize();
if (style.logicalMinHeight().isFixed())
minimumHeight = std::max(minimumHeight, style.logicalMinHeight().value());
// FIXME: This may need to be a layout time adjustment to support various values like fit-content etc.
style.setLogicalMinHeight(Length(minimumHeight, LengthType::Fixed));
}

#if ENABLE(INPUT_TYPE_COLOR)
if (style.effectiveAppearance() == StyleAppearance::ColorWell)
Expand Down

0 comments on commit 538824c

Please sign in to comment.