Title: [114690] trunk/Source/WebCore
Revision
114690
Author
[email protected]
Date
2012-04-19 16:30:28 -0700 (Thu, 19 Apr 2012)

Log Message

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

Patch by Alexandre Elias <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114689 => 114690)


--- trunk/Source/WebCore/ChangeLog	2012-04-19 23:27:28 UTC (rev 114689)
+++ trunk/Source/WebCore/ChangeLog	2012-04-19 23:30:28 UTC (rev 114690)
@@ -1,3 +1,30 @@
+2012-04-19  Alexandre Elias  <[email protected]>
+
+        Default to null value for HistoryItem::m_pageScaleFactor
+        https://bugs.webkit.org/show_bug.cgi?id=84385
+
+        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):
+
 2012-04-19  Alexis Menard  <[email protected]>
 
         Unreviewed Qt build warning fix.

Modified: trunk/Source/WebCore/history/HistoryItem.cpp (114689 => 114690)


--- trunk/Source/WebCore/history/HistoryItem.cpp	2012-04-19 23:27:28 UTC (rev 114689)
+++ trunk/Source/WebCore/history/HistoryItem.cpp	2012-04-19 23:30:28 UTC (rev 114690)
@@ -61,7 +61,7 @@
 HistoryItem::HistoryItem()
     : m_lastVisitedTime(0)
     , m_lastVisitWasHTTPNonGet(false)
-    , m_pageScaleFactor(1)
+    , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)
@@ -78,7 +78,7 @@
     , m_title(title)
     , m_lastVisitedTime(time)
     , m_lastVisitWasHTTPNonGet(false)
-    , m_pageScaleFactor(1)
+    , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)
@@ -97,7 +97,7 @@
     , m_displayTitle(alternateTitle)
     , m_lastVisitedTime(time)
     , m_lastVisitWasHTTPNonGet(false)
-    , m_pageScaleFactor(1)
+    , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)
@@ -117,7 +117,7 @@
     , m_title(title)
     , m_lastVisitedTime(0)
     , m_lastVisitWasHTTPNonGet(false)
-    , m_pageScaleFactor(1)
+    , m_pageScaleFactor(0)
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)

Modified: trunk/Source/WebCore/loader/HistoryController.cpp (114689 => 114690)


--- trunk/Source/WebCore/loader/HistoryController.cpp	2012-04-19 23:27:28 UTC (rev 114689)
+++ trunk/Source/WebCore/loader/HistoryController.cpp	2012-04-19 23:30:28 UTC (rev 114690)
@@ -126,7 +126,7 @@
         if (!view->wasScrolledByUser()) {
             view->setScrollPosition(m_currentItem->scrollPoint());
             Page* page = m_frame->page();
-            if (page && page->mainFrame() == m_frame)
+            if (page && page->mainFrame() == m_frame && m_currentItem->pageScaleFactor())
                 page->setPageScaleFactor(m_currentItem->pageScaleFactor(), m_currentItem->scrollPoint());
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to