Changeset 114690 in webkit


Ignore:
Timestamp:
Apr 19, 2012 4:30:28 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Default to null value for HistoryItem::m_pageScaleFactor
https://bugs.webkit.org/show_bug.cgi?id=84385

Patch by Alexandre Elias <aelias@google.com> on 2012-04-19
Reviewed by Nate Chapin.

Previously, HistoryItem::m_pageScaleFactor defaulted to a value
of 1, making it impossible to determine whether this value was never
set, or intentionally set to 1. This patch introduces a default value
of 0 and makes restoreScrollPositionAndViewState not touch the page
scale factor if this value is still present at time of reload.

This is a no-op change for common navigation scenarios. The
motivation for this change is the corner case of syncing history items
from a desktop browser to a mobile device. In that case, we need a
way to specify that the history item does not contain a
pageScaleFactor so that the mobile device does not display the page
overly zoomed in.

No new tests.

  • history/HistoryItem.cpp:

(WebCore::HistoryItem::HistoryItem):

  • loader/HistoryController.cpp:

(WebCore::HistoryController::restoreScrollPositionAndViewState):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r114689 r114690  
     12012-04-19  Alexandre Elias  <aelias@google.com>
     2
     3        Default to null value for HistoryItem::m_pageScaleFactor
     4        https://bugs.webkit.org/show_bug.cgi?id=84385
     5
     6        Reviewed by Nate Chapin.
     7
     8        Previously, HistoryItem::m_pageScaleFactor defaulted to a value
     9        of 1, making it impossible to determine whether this value was never
     10        set, or intentionally set to 1.  This patch introduces a default value
     11        of 0 and makes restoreScrollPositionAndViewState not touch the page
     12        scale factor if this value is still present at time of reload.
     13
     14        This is a no-op change for common navigation scenarios.  The
     15        motivation for this change is the corner case of syncing history items
     16        from a desktop browser to a mobile device.  In that case, we need a
     17        way to specify that the history item does not contain a
     18        pageScaleFactor so that the mobile device does not display the page
     19        overly zoomed in.
     20
     21        No new tests.
     22
     23        * history/HistoryItem.cpp:
     24        (WebCore::HistoryItem::HistoryItem):
     25        * loader/HistoryController.cpp:
     26        (WebCore::HistoryController::restoreScrollPositionAndViewState):
     27
    1282012-04-19  Alexis Menard  <alexis.menard@openbossa.org>
    229
  • trunk/Source/WebCore/history/HistoryItem.cpp

    r93669 r114690  
    6262    : m_lastVisitedTime(0)
    6363    , m_lastVisitWasHTTPNonGet(false)
    64     , m_pageScaleFactor(1)
     64    , m_pageScaleFactor(0)
    6565    , m_lastVisitWasFailure(false)
    6666    , m_isTargetItem(false)
     
    7979    , m_lastVisitedTime(time)
    8080    , m_lastVisitWasHTTPNonGet(false)
    81     , m_pageScaleFactor(1)
     81    , m_pageScaleFactor(0)
    8282    , m_lastVisitWasFailure(false)
    8383    , m_isTargetItem(false)
     
    9898    , m_lastVisitedTime(time)
    9999    , m_lastVisitWasHTTPNonGet(false)
    100     , m_pageScaleFactor(1)
     100    , m_pageScaleFactor(0)
    101101    , m_lastVisitWasFailure(false)
    102102    , m_isTargetItem(false)
     
    118118    , m_lastVisitedTime(0)
    119119    , m_lastVisitWasHTTPNonGet(false)
    120     , m_pageScaleFactor(1)
     120    , m_pageScaleFactor(0)
    121121    , m_lastVisitWasFailure(false)
    122122    , m_isTargetItem(false)
  • trunk/Source/WebCore/loader/HistoryController.cpp

    r113379 r114690  
    127127            view->setScrollPosition(m_currentItem->scrollPoint());
    128128            Page* page = m_frame->page();
    129             if (page && page->mainFrame() == m_frame)
     129            if (page && page->mainFrame() == m_frame && m_currentItem->pageScaleFactor())
    130130                page->setPageScaleFactor(m_currentItem->pageScaleFactor(), m_currentItem->scrollPoint());
    131131        }
Note: See TracChangeset for help on using the changeset viewer.