Avoid restoring scale factor 0 by HistoryController
authorChanghyup Jwa <ch.jwa@samsung.com>
Tue, 8 Oct 2013 10:33:32 +0000 (19:33 +0900)
committerChanghyup Jwa <ch.jwa@samsung.com>
Tue, 8 Oct 2013 11:13:00 +0000 (20:13 +0900)
[Title] Avoid restoring scale factor 0 by HistoryController
[Issue#] P131004-03246
[Problem] After going back to youtube, content is not rendered
[Cause] Scale factor which restored by HistoryController is 0
[Solution] Avoid 0 scale factor restoring

Change-Id: I750785fcf338c725655d3d8da89b2872af8ad906

Source/WebCore/history/HistoryItem.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp

index 5209cba..a9c7e1b 100644 (file)
@@ -62,6 +62,9 @@ HistoryItem::HistoryItem()
     : m_lastVisitedTime(0)
     , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
+#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+    , m_contentsScaleFactor(0)
+#endif
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)
@@ -79,6 +82,9 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, double ti
     , m_lastVisitedTime(time)
     , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
+#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+    , m_contentsScaleFactor(0)
+#endif
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)
@@ -98,6 +104,9 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, const Str
     , m_lastVisitedTime(time)
     , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
+#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+    , m_contentsScaleFactor(0)
+#endif
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)
@@ -118,6 +127,9 @@ HistoryItem::HistoryItem(const KURL& url, const String& target, const String& pa
     , m_lastVisitedTime(0)
     , m_lastVisitWasHTTPNonGet(false)
     , m_pageScaleFactor(0)
+#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+    , m_contentsScaleFactor(0)
+#endif
     , m_lastVisitWasFailure(false)
     , m_isTargetItem(false)
     , m_visitCount(0)
@@ -148,6 +160,9 @@ inline HistoryItem::HistoryItem(const HistoryItem& item)
     , m_lastVisitWasHTTPNonGet(item.m_lastVisitWasHTTPNonGet)
     , m_scrollPoint(item.m_scrollPoint)
     , m_pageScaleFactor(item.m_pageScaleFactor)
+#if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
+    , m_contentsScaleFactor(item.m_contentsScaleFactor)
+#endif
     , m_lastVisitWasFailure(item.m_lastVisitWasFailure)
     , m_isTargetItem(item.m_isTargetItem)
     , m_visitCount(item.m_visitCount)
index 235ce0d..74cb953 100755 (executable)
@@ -817,6 +817,9 @@ void PageClientImpl::pageDidRequestScroll(const IntPoint& point)
 #if ENABLE(TIZEN_WEBKIT2_HISTORICAL_RESTORE_VISIBLE_CONTENT_RECT)
 void PageClientImpl::pageDidRequestRestoreVisibleContentRect(const IntPoint& point, float scale)
 {
+    if (!scale)
+        return;
+
     m_restoredScrollPosition = point;
     m_restoredScrollPosition.scale(scale, scale);
     m_restoredScaleFactor = scale;