Changeset 125680 in webkit


Ignore:
Timestamp:
Aug 15, 2012 9:20:39 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Use nested layout when rotating
https://bugs.webkit.org/show_bug.cgi?id=94117

Partially patched by Arvid Nilsson.

Patch by Leo Yang <leoyang@rim.com> on 2012-08-15
Reviewed by George Staikos.
Reviewed internally by Arvid Nilsson.

When rotating the content width used for fixedLayoutSize is not
correct because we are changing the rotation and the content with
should be determined after layout. So we set the with to 0 if we
are rotating and beginning the nested layout. And in setViewportSize
we need a nested layout loop to trigger zoom-to-fit.

  • Api/WebPage.cpp:

(BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):

Location:
trunk/Source/WebKit/blackberry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/WebPage.cpp

    r125678 r125680  
    25222522        // it'll still be clamped by the maxWidth below...
    25232523        int width = std::max(absoluteVisibleOverflowSize().width(), contentsSize().width());
     2524        if (m_pendingOrientation != -1 && !m_nestedLayoutFinishedCount)
     2525            width = 0;
    25242526
    25252527        if (snapToIncrement) {
     
    38523854    }
    38533855
    3854     if (needsLayout)
    3855         setNeedsLayout();
    3856 
    38573856    // Need to resume so that the backingstore will start recording the invalidated
    38583857    // rects from below.
     
    38613860    // We might need to layout here to get a correct contentsSize so that zoomToFit
    38623861    // is calculated correctly.
    3863     requestLayoutIfNeeded();
     3862    while (needsLayout) {
     3863        setNeedsLayout();
     3864        requestLayoutIfNeeded();
     3865        needsLayout = false;
     3866
     3867        // Emulate the zoomToFitWidthOnLoad algorithm if we're rotating.
     3868        ++m_nestedLayoutFinishedCount;
     3869        if (needsLayoutToFindContentSize) {
     3870            if (setViewMode(viewMode()))
     3871                needsLayout = true;
     3872        }
     3873    }
     3874    m_nestedLayoutFinishedCount = 0;
    38643875
    38653876    // As a special case if we were zoomed to the initial scale at the beginning
  • trunk/Source/WebKit/blackberry/ChangeLog

    r125679 r125680  
     12012-08-15  Leo Yang  <leoyang@rim.com>
     2
     3        [BlackBerry] Use nested layout when rotating
     4        https://bugs.webkit.org/show_bug.cgi?id=94117
     5
     6        Partially patched by Arvid Nilsson.
     7
     8        Reviewed by George Staikos.
     9        Reviewed internally by Arvid Nilsson.
     10
     11        When rotating the content width used for fixedLayoutSize is not
     12        correct because we are changing the rotation and the content with
     13        should be determined after layout. So we set the with to 0 if we
     14        are rotating and beginning the nested layout. And in setViewportSize
     15        we need a nested layout loop to trigger zoom-to-fit.
     16
     17        * Api/WebPage.cpp:
     18        (BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
     19        (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
     20
    1212012-08-14  Antonio Gomes  <agomes@rim.com>
    222
Note: See TracChangeset for help on using the changeset viewer.