Bug 240947

Summary: -webkit-text-size-adjust doesn't work correctly on iPad
Product: WebKit Reporter: Haowen <chenhaowen0116>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer, wenson_hsieh, zalan
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: iPhone / iPad   
OS: iOS 15   
Attachments:
Description Flags
How it looks like on iPad none

Description Haowen 2022-05-26 01:56:52 PDT
Created attachment 459778 [details]
How it looks like on iPad

`configuration.defaultWebpagePreferences.preferredContentMode` has been set to `.mobile`
But “webkit-text-size-adjust” doesn't work correctly on iPad. 
On iPhone, set “webkit-text-size-adjust” with 200%, both font-size and line-height will be scaled.
But on iPad, only font-size gets scaled, line-height doesn't change.

* STEPS TO REPRODUCE
1. Create a WKWebView with `config.defaultWebpagePreferences.preferredContentMode = .mobile`
2. loadHTMLString in WebView with "<h1 style="-webkit-text-size-adjust: 200%; font-size: 100px; line-height: 100px">Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!Hello, World!</h1>"
3. Run the app on iPhone and iPad

* RESULTS

Correct: On iPhone, the font-size and the line-height are all scaled to 200px

Incorrect: On iPad, the font-size is scaled but the line-height is still 100px
Comment 1 Radar WebKit Bug Importer 2022-06-02 01:57:13 PDT
<rdar://problem/94274628>