Bug 219372

Summary: [iOS] <button> with multi-line content does not render properly
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, darin, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, webkit-bug-importer, wenson_hsieh, zalan
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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].