⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 169929 in webkit


Ignore:
Timestamp:
Jun 12, 2014, 9:20:05 PM (12 years ago)
Author:
benjamin@webkit.org
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 <​bpoulain@apple.com> 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):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r169926 r169929  
     12014-06-12  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        [iOS][WK2] Do not update the viewport configuration on load until the first viewport arguments is received
     4        https://bugs.webkit.org/show_bug.cgi?id=133719
     5        <rdar://problem/17008149>
     6
     7        Reviewed by Simon Fraser.
     8
     9        When pages are loaded from the page cache, we were updating the viewport to the initial values
     10        in WebPage::dynamicViewportSizeUpdate(), then update the viewport again when the page's viewport argument
     11        are received.
     12
     13        The problem is that was messing up with text autosizing. The page would relayout with the default viewport
     14        configuration, adopt the text autosizing parameters from that size, then remain in that state when
     15        the actual viewport configuration would be set.
     16
     17        With this patch, the viewport configuration is updated from the values in WebCore instead of with default values.
     18        For new documents, this is strictly equivalent. For documents coming from the page cache, the values are from
     19        the previous state of the page, which ensure we do not restart negotiating a viewport configuration from scratch.
     20
     21        * WebProcess/WebPage/WebPage.cpp:
     22        (WebKit::WebPage::didCommitLoad):
     23
    1242014-06-12  Gavin Barraclough  <barraclough@apple.com>
    225
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r169869 r169929  
    43584358    resetViewportDefaultConfiguration(frame);
    43594359    m_viewportConfiguration.resetMinimalUI();
    4360     m_viewportConfiguration.setViewportArguments(ViewportArguments());
    4361     m_viewportConfiguration.setContentsSize(IntSize());
     4360    const Frame* coreFrame = frame->coreFrame();
     4361    m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize());
     4362    m_viewportConfiguration.setViewportArguments(coreFrame->document()->viewportArguments());
    43624363    viewportConfigurationChanged();
    43634364#endif
Note: See TracChangeset for help on using the changeset viewer.