Bug 219372 - [iOS] <button> with multi-line content does not render properly
Summary: [iOS] <button> with multi-line content does not render properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Other
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Aditya Keerthi
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-11-30 14:47 PST by Aditya Keerthi
Modified: 2020-12-01 12:57 PST (History)
11 users (show)

See Also:


Attachments
Patch (8.24 KB, patch)
2020-11-30 14:59 PST, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (8.33 KB, patch)
2020-11-30 15:55 PST, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (31.20 KB, patch)
2020-12-01 09:09 PST, Aditya Keerthi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Keerthi 2020-11-30 14:47:19 PST
The contents are clipped to a single line, unless -webkit-appearance: none is specified.
Comment 1 Aditya Keerthi 2020-11-30 14:47:39 PST
<rdar://problem/6061602>
Comment 2 Aditya Keerthi 2020-11-30 14:59:52 PST
Created attachment 415065 [details]
Patch
Comment 3 Darin Adler 2020-11-30 15:10:26 PST
Comment on attachment 415065 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=415065&action=review

> Source/WebCore/rendering/RenderThemeIOS.mm:1031
> +        style.setMinHeight(Length(static_cast<int>(ControlBaseHeight / ControlBaseFontSize * style.fontDescription().computedSize()), Fixed));

Is it good to still be doing a floor operation here (static_cast<int>) rather than a rounding or a ceiling operation?
Comment 4 Aditya Keerthi 2020-11-30 15:55:01 PST
(In reply to Darin Adler from comment #3)
> Comment on attachment 415065 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=415065&action=review
> 
> > Source/WebCore/rendering/RenderThemeIOS.mm:1031
> > +        style.setMinHeight(Length(static_cast<int>(ControlBaseHeight / ControlBaseFontSize * style.fontDescription().computedSize()), Fixed));
> 
> Is it good to still be doing a floor operation here (static_cast<int>)
> rather than a rounding or a ceiling operation?

I think we can just remove the rounding entirely, for a more precise min-height. Uploading a new patch which does this.

I will also revisit the height calculation in the near future, as it may change due to the iOS form control redesign.
Comment 5 Aditya Keerthi 2020-11-30 15:55:12 PST
Created attachment 415071 [details]
Patch
Comment 6 Aditya Keerthi 2020-12-01 09:09:50 PST
Created attachment 415140 [details]
Patch
Comment 7 Aditya Keerthi 2020-12-01 09:10:50 PST
Rebaselined existing tests to account for the change.
Comment 8 EWS 2020-12-01 12:57:34 PST
Committed r270325: <https://trac.webkit.org/changeset/270325>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 415140 [details].