Bug 145225

Summary: [iOS] Using CSS viewport units causes incorrect layout
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebKit2Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, darin, sam, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 146090    
Attachments:
Description Flags
Test case
none
Patch benjamin: review+, benjamin: commit-queue-

Description Enrica Casucci 2015-05-20 15:20:27 PDT
Created attachment 253465 [details]
Test case

Run the attached test case on Safari on iPad.
You'll see the text is very small because the initial scale is computed incorrectly.

rdar://problem/20924495
Comment 1 Enrica Casucci 2015-05-20 15:25:51 PDT
Created attachment 253467 [details]
Patch
Comment 2 Darin Adler 2015-05-20 16:14:28 PDT
I’d love to help by reviewing this, but seems like Ben or Tim should review.
Comment 3 Benjamin Poulain 2015-05-20 17:17:10 PDT
Comment on attachment 253467 [details]
Patch

I cannot think of a case where that would break something...but it seems wrong to use shouldIgnoreScalingConstraints() in the case initialScaleIgnoringContentSize().

That means the end results will depend on the shouldIgnoreScalingConstraints() heuristic, which seems wrong.

You should pass shouldIgnoreScalingConstraints() as an argument to initialScaleFromSize() to make sure it is fully independent from the content size.
Comment 4 Enrica Casucci 2015-05-20 17:38:58 PDT
I want to implement what Ben suggested.
Comment 5 Enrica Casucci 2015-05-20 17:52:51 PDT
Committed revision 184681.