Bug 240947 - -webkit-text-size-adjust doesn't work correctly on iPad
Summary: -webkit-text-size-adjust doesn't work correctly on iPad
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-26 01:56 PDT by Haowen
Modified: 2022-06-02 01:57 PDT (History)
3 users (show)

See Also:


Attachments
How it looks like on iPad (276.70 KB, image/png)
2022-05-26 01:56 PDT, Haowen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>