Bug 145225 - [iOS] Using CSS viewport units causes incorrect layout
Summary: [iOS] Using CSS viewport units causes incorrect layout
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords:
Depends on:
Blocks: 146090
  Show dependency treegraph
 
Reported: 2015-05-20 15:20 PDT by Enrica Casucci
Modified: 2015-06-17 17:45 PDT (History)
4 users (show)

See Also:


Attachments
Test case (2.81 KB, text/html)
2015-05-20 15:20 PDT, Enrica Casucci
no flags Details
Patch (5.36 KB, patch)
2015-05-20 15:25 PDT, Enrica Casucci
benjamin: review+
benjamin: commit-queue-
Details | Formatted Diff | Diff

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