Title: [169929] trunk/Source/WebKit2
Revision
169929
Author
[email protected]
Date
2014-06-12 21:20:05 -0700 (Thu, 12 Jun 2014)

Log Message

[iOS][WK2] Do not update the viewport configuration on load until the first viewport arguments is received
https://bugs.webkit.org/show_bug.cgi?id=133719
<rdar://problem/17008149>

Patch by Benjamin Poulain <[email protected]> on 2014-06-12
Reviewed by Simon Fraser.

When pages are loaded from the page cache, we were updating the viewport to the initial values
in WebPage::dynamicViewportSizeUpdate(), then update the viewport again when the page's viewport argument
are received.

The problem is that was messing up with text autosizing. The page would relayout with the default viewport
configuration, adopt the text autosizing parameters from that size, then remain in that state when
the actual viewport configuration would be set.

With this patch, the viewport configuration is updated from the values in WebCore instead of with default values.
For new documents, this is strictly equivalent. For documents coming from the page cache, the values are from
the previous state of the page, which ensure we do not restart negotiating a viewport configuration from scratch.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (169928 => 169929)


--- trunk/Source/WebKit2/ChangeLog	2014-06-13 03:58:46 UTC (rev 169928)
+++ trunk/Source/WebKit2/ChangeLog	2014-06-13 04:20:05 UTC (rev 169929)
@@ -1,3 +1,26 @@
+2014-06-12  Benjamin Poulain  <[email protected]>
+
+        [iOS][WK2] Do not update the viewport configuration on load until the first viewport arguments is received
+        https://bugs.webkit.org/show_bug.cgi?id=133719
+        <rdar://problem/17008149>
+
+        Reviewed by Simon Fraser.
+
+        When pages are loaded from the page cache, we were updating the viewport to the initial values
+        in WebPage::dynamicViewportSizeUpdate(), then update the viewport again when the page's viewport argument
+        are received.
+
+        The problem is that was messing up with text autosizing. The page would relayout with the default viewport
+        configuration, adopt the text autosizing parameters from that size, then remain in that state when
+        the actual viewport configuration would be set.
+
+        With this patch, the viewport configuration is updated from the values in WebCore instead of with default values.
+        For new documents, this is strictly equivalent. For documents coming from the page cache, the values are from
+        the previous state of the page, which ensure we do not restart negotiating a viewport configuration from scratch.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didCommitLoad):
+
 2014-06-12  Gavin Barraclough  <[email protected]>
 
         Add support for thread/WorkQueue QoS

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (169928 => 169929)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-06-13 03:58:46 UTC (rev 169928)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-06-13 04:20:05 UTC (rev 169929)
@@ -4357,8 +4357,9 @@
 
     resetViewportDefaultConfiguration(frame);
     m_viewportConfiguration.resetMinimalUI();
-    m_viewportConfiguration.setViewportArguments(ViewportArguments());
-    m_viewportConfiguration.setContentsSize(IntSize());
+    const Frame* coreFrame = frame->coreFrame();
+    m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize());
+    m_viewportConfiguration.setViewportArguments(coreFrame->document()->viewportArguments());
     viewportConfigurationChanged();
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to