Changeset 122589 in webkit
- Timestamp:
- Jul 13, 2012 9:11:13 AM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r122476 r122589 338 338 , m_activationState(ActivationActive) 339 339 , m_shouldResetTilesWhenShown(false) 340 , m_shouldZoomToInitialScaleAfterLoadFinished(false) 340 341 , m_userScalable(true) 341 342 , m_userPerformedManualZoom(false) … … 1055 1056 m_backingStore->d->resetTiles(true /* resetBackground */); 1056 1057 m_backingStore->d->setScrollingOrZooming(false, false /* shouldBlit */); 1058 m_shouldZoomToInitialScaleAfterLoadFinished = false; 1057 1059 m_userPerformedManualZoom = false; 1058 1060 m_userPerformedManualScroll = false; … … 1700 1702 m_nestedLayoutFinishedCount++; 1701 1703 1702 if (shouldZoomToInitialScaleOnLoad()) 1704 if (shouldZoomToInitialScaleOnLoad()) { 1703 1705 zoomToInitialScaleOnLoad(); 1704 else if (loadState() != None) 1706 m_shouldZoomToInitialScaleAfterLoadFinished = false; 1707 } else if (loadState() != None) 1705 1708 notifyTransformedContentsSizeChanged(); 1706 1709 … … 1735 1738 } 1736 1739 } 1737 }1738 1739 bool WebPagePrivate::shouldZoomToInitialScaleOnLoad() const1740 {1741 // For FrameLoadTypeSame or FrameLoadTypeStandard load, the layout timer can be fired which can call dispatchDidFirstVisuallyNonEmptyLayout()1742 // after the load Finished state, in which case the web page will have no chance to zoom to initial scale. So we should give it a chance,1743 // otherwise the scale of the web page can be incorrect.1744 FrameLoadType frameLoadType = FrameLoadTypeStandard;1745 if (m_mainFrame && m_mainFrame->loader())1746 frameLoadType = m_mainFrame->loader()->loadType();1747 if (m_loadState == Committed || (m_loadState == Finished && (frameLoadType == FrameLoadTypeSame || frameLoadType == FrameLoadTypeStandard)))1748 return true;1749 return false;1750 1740 } 1751 1741 -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r122444 r122589 208 208 void notifyDismissAutofillDialog(); 209 209 210 bool shouldZoomToInitialScaleOnLoad() const; 210 bool shouldZoomToInitialScaleOnLoad() const { return loadState() == Committed || m_shouldZoomToInitialScaleAfterLoadFinished; } 211 void setShouldZoomToInitialScaleAfterLoadFinished(bool shouldZoomToInitialScaleAfterLoadFinished) 212 { 213 m_shouldZoomToInitialScaleAfterLoadFinished = shouldZoomToInitialScaleAfterLoadFinished; 214 } 215 211 216 // Called according to our heuristic or from setLoadState depending on whether we have a virtual viewport. 212 217 void zoomToInitialScaleOnLoad(); … … 461 466 ActivationStateType m_activationState; 462 467 bool m_shouldResetTilesWhenShown; 468 bool m_shouldZoomToInitialScaleAfterLoadFinished; 463 469 bool m_userScalable; 464 470 bool m_userPerformedManualZoom; -
trunk/Source/WebKit/blackberry/ChangeLog
r122587 r122589 1 2012-07-13 Jacky Jiang <zhajiang@rim.com> 2 3 [BlackBerry] resetBitmapZoomScale called while zooming preventing pinch zoom 4 https://bugs.webkit.org/show_bug.cgi?id=91247 5 6 Reviewed by Antonio Gomes. 7 8 PR: 175432 9 On yahoo.com, the web page stopped zooming while trying to pinch as 10 WebPageClient::resetBitmapZoomScale(double) was being called by 11 WebPagePrivate::zoomToInitialScaleOnLoad() after load finished. 12 And also yahoo.com was keeping updating layout, which made it really 13 bad that zoomToInitialScaleOnLoad() was called many times when load 14 finished and the load type was FrameLoadTypeStandard or FrameLoadTypeSame. 15 As we only care about the situation that dispatchDidFirstVisuallyNonEmptyLayout() 16 happens after load finished, we can move the code to that method and 17 set a flag for WebPage layoutFinished() and zoomToInitialScaleOnLoad() 18 instead. In this way, we can ensure that the flag is only enabled when 19 dispatchDidFirstVisuallyNonEmptyLayout() is called after load finished 20 and get rid of calling zoomToInitialScaleOnLoad() lots of times when 21 keeping updating layout in such kind of situation. 22 23 Internally reviewed by Arvid Nilsson 24 25 * Api/WebPage.cpp: 26 (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): 27 (BlackBerry::WebKit::WebPagePrivate::setLoadState): 28 (BlackBerry::WebKit::WebPagePrivate::layoutFinished): 29 * Api/WebPage_p.h: 30 (BlackBerry::WebKit::WebPagePrivate::shouldZoomToInitialScaleOnLoad): 31 (BlackBerry::WebKit::WebPagePrivate::setShouldZoomToInitialScaleAfterLoadFinished): 32 (WebPagePrivate): 33 * WebCoreSupport/FrameLoaderClientBlackBerry.cpp: 34 (WebCore::FrameLoaderClientBlackBerry::dispatchDidFirstVisuallyNonEmptyLayout): 35 1 36 2012-07-13 Jakob Petsovits <jpetsovits@rim.com> 2 37 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
r120694 r122589 826 826 readyToRender(true); 827 827 828 // For FrameLoadTypeSame or FrameLoadTypeStandard load, the layout timer can be fired which can call 829 // dispatchDidFirstVisuallyNonEmptyLayout() after the load Finished state, in which case the web page 830 // will have no chance to zoom to initial scale. So we should give it a chance, otherwise the scale of 831 // the web page can be incorrect. 832 FrameLoadType frameLoadType = m_frame->loader()->loadType(); 833 if (m_webPagePrivate->loadState() == WebPagePrivate::Finished && (frameLoadType == FrameLoadTypeSame || frameLoadType == FrameLoadTypeStandard)) 834 m_webPagePrivate->setShouldZoomToInitialScaleAfterLoadFinished(true); 835 828 836 if (m_webPagePrivate->shouldZoomToInitialScaleOnLoad()) { 829 837 m_webPagePrivate->zoomToInitialScaleOnLoad(); // Set the proper zoom level first.
Note: See TracChangeset
for help on using the changeset viewer.