Changeset 124643 in webkit
- Timestamp:
- Aug 3, 2012 12:58:17 PM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r124639 r124643 6462 6462 m_mainFrame->setTextZoomFactor(textZoomFactor); 6463 6463 } 6464 } 6465 } 6464 6465 void WebPagePrivate::restoreHistoryViewState(Platform::IntSize contentsSize, Platform::IntPoint scrollPosition, double scale, bool shouldReflowBlock) 6466 { 6467 if (!m_mainFrame) 6468 return; 6469 6470 m_backingStore->d->suspendScreenAndBackingStoreUpdates(); // don't flash checkerboard for the setScrollPosition call 6471 m_mainFrame->view()->setContentsSizeFromHistory(contentsSize); 6472 6473 // Here we need to set scroll position what we asked for. 6474 // So we use ScrollView::constrainsScrollingToContentEdge(false). 6475 bool oldConstrainsScrollingToContentEdge = m_mainFrame->view()->constrainsScrollingToContentEdge(); 6476 m_mainFrame->view()->setConstrainsScrollingToContentEdge(false); 6477 setScrollPosition(scrollPosition); 6478 m_mainFrame->view()->setConstrainsScrollingToContentEdge(oldConstrainsScrollingToContentEdge); 6479 6480 m_shouldReflowBlock = shouldReflowBlock; 6481 6482 bool didZoom = zoomAboutPoint(scale, m_mainFrame->view()->scrollPosition(), true /* enforceScaleClamping */, true /*forceRendering*/, true /*isRestoringZoomLevel*/); 6483 // If we're already at that scale, then we should still force rendering 6484 // since our scroll position changed. 6485 m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit); 6486 6487 if (!didZoom) { 6488 // We need to notify the client of the scroll position and content size change(s) above even if we didn't scale. 6489 notifyTransformedContentsSizeChanged(); 6490 notifyTransformedScrollChanged(); 6491 } 6492 } 6493 6494 } 6495 } -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r124639 r124643 136 136 void setTextReflowAnchorPoint(const Platform::IntPoint& focalPoint); 137 137 138 void schedulePinchZoomAboutPoint(double scale, const WebCore::IntPoint& anchor);138 void restoreHistoryViewState(Platform::IntSize contentsSize, Platform::IntPoint scrollPosition, double scale, bool shouldReflowBlock); 139 139 140 140 // Perform actual zoom for block zoom. -
trunk/Source/WebKit/blackberry/ChangeLog
r124639 r124643 1 2012-08-03 Yong Li <yoli@rim.com> 2 3 [BlackBerry] FrameLoaderClient::restoreViewState() shouldn't trigger painting 4 https://bugs.webkit.org/show_bug.cgi?id=93141 5 6 Reviewed by Rob Buis. 7 8 PR# 172041. 9 It is not always safe to render the page at this point. So we post a message 10 instead. 11 12 * Api/WebPage.cpp: 13 (WebKit): 14 (BlackBerry::WebKit::WebPagePrivate::restoreHistoryViewState): 15 * Api/WebPage_p.h: 16 (WebPagePrivate): 17 * WebCoreSupport/FrameLoaderClientBlackBerry.cpp: 18 (WebCore::FrameLoaderClientBlackBerry::restoreViewState): 19 1 20 2012-08-03 Konrad Piascik <kpiascik@rim.com> 2 21 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
r124403 r124643 69 69 #include "WebPageClient.h" 70 70 71 #include <BlackBerryPlatformExecutableMessage.h> 71 72 #include <BlackBerryPlatformLog.h> 72 73 #include <BlackBerryPlatformMediaDocument.h> 74 #include <BlackBerryPlatformMessageClient.h> 73 75 #include <BlackBerryPlatformScreen.h> 74 76 #include <JavaScriptCore/APICast.h> … … 1086 1088 if (orientationChanged && viewState.isZoomToFitScale) 1087 1089 scale = BlackBerry::Platform::Graphics::Screen::primaryScreen()->width() * scale / static_cast<double>(BlackBerry::Platform::Graphics::Screen::primaryScreen()->height()); 1088 m_webPagePrivate->m_backingStore->d->suspendScreenAndBackingStoreUpdates(); // don't flash checkerboard for the setScrollPosition call 1089 m_frame->view()->setContentsSizeFromHistory(contentsSize); 1090 1091 // Here we need to set scroll position what we asked for. 1092 // So we use ScrollView::setCanOverscroll(true). 1093 bool oldCanOverscroll = m_frame->view()->canOverScroll(); 1094 m_frame->view()->setCanOverscroll(true); 1095 m_webPagePrivate->setScrollPosition(scrollPosition); 1096 m_frame->view()->setCanOverscroll(oldCanOverscroll); 1097 1098 m_webPagePrivate->m_shouldReflowBlock = viewState.shouldReflowBlock; 1099 1100 bool didZoom = m_webPagePrivate->zoomAboutPoint(scale, m_frame->view()->scrollPosition(), true /* enforceScaleClamping */, true /*forceRendering*/, true /*isRestoringZoomLevel*/); 1101 // If we're already at that scale, then we should still force rendering 1102 // since our scroll position changed. 1103 m_webPagePrivate->m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit); 1104 1105 if (!didZoom) { 1106 // We need to notify the client of the scroll position and content size change(s) above even if we didn't scale. 1107 m_webPagePrivate->notifyTransformedContentsSizeChanged(); 1108 m_webPagePrivate->notifyTransformedScrollChanged(); 1109 } 1090 1091 // It is not safe to render the page at this point. So we post a message instead. Messages have higher priority than timers. 1092 BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(BlackBerry::Platform::createMethodCallMessage( 1093 &WebPagePrivate::restoreHistoryViewState, m_webPagePrivate, contentsSize, scrollPosition, scale, viewState.shouldReflowBlock)); 1110 1094 } 1111 1095
Note: See TracChangeset
for help on using the changeset viewer.