Changeset 129545 in webkit
- Timestamp:
- Sep 25, 2012, 1:01:33 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 87 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129543 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 This patch merges didFirstLayout, didFirstVisuallyNonEmptyLayout, 12 and didNewFirstVisuallyNonEmptyLayout. Page keeps track of which 13 layout milestones we are interested in with a bit mask, so that 14 different ports/clients can opt-into different milestones. This 15 will allow us to safely add more layout milestones in the future 16 if that seems worthwhile. 17 18 Include new file LayoutMilestoneOptions.h 19 * GNUmakefile.list.am: 20 * Target.pri: 21 * WebCore.exp.in: 22 * WebCore.gypi: 23 * WebCore.xcodeproj/project.pbxproj: 24 25 Remove dispatchDidFirstLayout, 26 dispatchDidFirstVisuallyNonEmptyLayout, and 27 dispatchDidNewFirstVisuallyNonEmptyLayout. They are now replaced 28 by dispatchDidLayout(LayoutMilestoneOptions) 29 * loader/EmptyClients.h: 30 (WebCore::EmptyFrameLoaderClient::dispatchDidLayout): 31 * loader/FrameLoader.cpp: 32 (WebCore::FrameLoader::didLayout): 33 * loader/FrameLoader.h: 34 (FrameLoader): 35 * loader/FrameLoaderClient.h: 36 (FrameLoaderClient): 37 (WebCore::FrameLoaderClient::dispatchDidLayout): 38 * page/LayoutMilestoneOptions.h: Added. 39 (WebCore): 40 41 Check with Page to find out which layout milestones the client is 42 interested in, and then dispatch the notifications when 43 appropriate. 44 * page/FrameView.cpp: 45 (WebCore::FrameView::performPostLayoutTasks): 46 47 Remove setRelevantRepaintedObjectsCounterThreshold(). Instead keep 48 track of the layout milestones bit mask. 49 * page/Page.cpp: 50 (WebCore::Page::Page): 51 (WebCore::Page::addLayoutMilestones): 52 (WebCore): 53 (WebCore::Page::isCountingRelevantRepaintedObjects): 54 (WebCore::Page::addRelevantRepaintedObject): 55 * page/Page.h: 56 (Page): 57 (WebCore::Page::layoutMilestones): 58 1 59 2012-09-25 Andreas Kling <kling@webkit.org> 2 60 -
trunk/Source/WebCore/GNUmakefile.list.am
r129423 r129545 3993 3993 Source/WebCore/page/History.cpp \ 3994 3994 Source/WebCore/page/History.h \ 3995 Source/WebCore/page/LayoutMilestones.h \ 3995 3996 Source/WebCore/page/Location.cpp \ 3996 3997 Source/WebCore/page/Location.h \ -
trunk/Source/WebCore/Target.pri
r129423 r129545 1995 1995 page/GroupSettings.h \ 1996 1996 page/History.h \ 1997 page/LayoutMilestones.h \ 1997 1998 page/Location.h \ 1998 1999 page/MouseEventWithHitTestResults.h \ -
trunk/Source/WebCore/WebCore.exp.in
r129543 r129545 678 678 __ZN7WebCore4Page18removeSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE 679 679 __ZN7WebCore4Page18setPageScaleFactorEfRKNS_8IntPointE 680 __ZN7WebCore4Page19addLayoutMilestonesEj 680 681 __ZN7WebCore4Page19visitedStateChangedEPNS_9PageGroupEy 681 682 __ZN7WebCore4Page20setDeviceScaleFactorEf … … 694 695 __ZN7WebCore4Page36suspendActiveDOMObjectsAndAnimationsEv 695 696 __ZN7WebCore4Page37setInLowQualityImageInterpolationModeEb 696 __ZN7WebCore4Page43setRelevantRepaintedObjectsCounterThresholdEy697 697 __ZN7WebCore4Page6goBackEv 698 698 __ZN7WebCore4Page8goToItemEPNS_11HistoryItemENS_13FrameLoadTypeE -
trunk/Source/WebCore/WebCore.gypi
r129423 r129545 3128 3128 'page/History.cpp', 3129 3129 'page/History.h', 3130 'page/LayoutMilestones.h', 3130 3131 'page/Location.cpp', 3131 3132 'page/Location.h', -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r129444 r129545 3153 3153 93153BE414195B2A00FCF5BE /* inputSpeech.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BE314195B2900FCF5BE /* inputSpeech.png */; }; 3154 3154 931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3155 931D72F615FE695300C4C07E /* LayoutMilestones.h in Headers */ = {isa = PBXBuildFile; fileRef = 931D72F515FE695300C4C07E /* LayoutMilestones.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3155 3156 9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; }; 3156 3157 9327A94209968D1A0068A546 /* HTMLOptionsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */; }; … … 10342 10343 93153BE314195B2900FCF5BE /* inputSpeech.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = inputSpeech.png; sourceTree = "<group>"; }; 10343 10344 931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaCanStartListener.h; sourceTree = "<group>"; }; 10345 931D72F515FE695300C4C07E /* LayoutMilestones.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutMilestones.h; sourceTree = "<group>"; }; 10344 10346 9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLOptionsCollection.cpp; sourceTree = "<group>"; }; 10345 10347 932871BF0B20DEB70049035A /* PlatformMenuDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformMenuDescription.h; sourceTree = "<group>"; }; … … 15837 15839 BC94D1510C275C8B006BC617 /* History.h */, 15838 15840 BC94D1520C275C8B006BC617 /* History.idl */, 15841 931D72F515FE695300C4C07E /* LayoutMilestones.h */, 15839 15842 BCE1C41A0D982980003B02F2 /* Location.cpp */, 15840 15843 BCE1C4190D982980003B02F2 /* Location.h */, … … 25571 25574 FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */, 25572 25575 4F7B4A6615FF6D6A006B5F22 /* PlatformMemoryInstrumentation.h in Headers */, 25576 931D72F615FE695300C4C07E /* LayoutMilestones.h in Headers */, 25573 25577 ); 25574 25578 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/loader/EmptyClients.h
r128572 r129545 261 261 virtual void dispatchDidFinishDocumentLoad() { } 262 262 virtual void dispatchDidFinishLoad() { } 263 virtual void dispatchDidFirstLayout() { } 264 virtual void dispatchDidFirstVisuallyNonEmptyLayout() { } 265 virtual void dispatchDidNewFirstVisuallyNonEmptyLayout() { } 263 virtual void dispatchDidLayout(LayoutMilestones) { } 266 264 267 265 virtual Frame* dispatchCreatePage(const NavigationAction&) { return 0; } -
trunk/Source/WebCore/loader/FrameLoader.cpp
r129462 r129545 2286 2286 } 2287 2287 2288 void FrameLoader::didFirstLayout() 2289 { 2290 if (m_frame->page() && isBackForwardLoadType(m_loadType)) 2291 history()->restoreScrollPositionAndViewState(); 2292 2293 if (m_stateMachine.committedFirstRealDocumentLoad() && !m_stateMachine.isDisplayingInitialEmptyDocument() && !m_stateMachine.firstLayoutDone()) 2294 m_stateMachine.advanceTo(FrameLoaderStateMachine::FirstLayoutDone); 2295 2296 m_client->dispatchDidFirstLayout(); 2297 } 2298 2299 void FrameLoader::didFirstVisuallyNonEmptyLayout() 2300 { 2301 m_client->dispatchDidFirstVisuallyNonEmptyLayout(); 2302 } 2303 2304 void FrameLoader::didNewFirstVisuallyNonEmptyLayout() 2305 { 2306 m_client->dispatchDidNewFirstVisuallyNonEmptyLayout(); 2288 void FrameLoader::didLayout(LayoutMilestones milestones) 2289 { 2290 if (milestones & DidFirstLayout) { 2291 if (m_frame->page() && isBackForwardLoadType(m_loadType)) 2292 history()->restoreScrollPositionAndViewState(); 2293 2294 if (m_stateMachine.committedFirstRealDocumentLoad() && !m_stateMachine.isDisplayingInitialEmptyDocument() && !m_stateMachine.firstLayoutDone()) 2295 m_stateMachine.advanceTo(FrameLoaderStateMachine::FirstLayoutDone); 2296 } 2297 2298 m_client->dispatchDidLayout(milestones); 2307 2299 } 2308 2300 -
trunk/Source/WebCore/loader/FrameLoader.h
r128418 r129545 39 39 #include "IconController.h" 40 40 #include "IconURL.h" 41 #include "LayoutMilestones.h" 41 42 #include "PolicyChecker.h" 42 43 #include "ResourceHandle.h" … … 175 176 CachePolicy subresourceCachePolicy() const; 176 177 177 void didFirstLayout(); 178 179 // FIXME: didFirstVisuallyNonEmptyLayout() and didNewFirstVisuallyNonEmptyLayout() should be merged. 180 // The only reason for both to exist is to experiment with different heuristics for the time being. 181 void didFirstVisuallyNonEmptyLayout(); 182 void didNewFirstVisuallyNonEmptyLayout(); 178 void didLayout(LayoutMilestones); 183 179 184 180 void loadedResourceFromMemoryCache(CachedResource*); -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r129020 r129545 33 33 #include "FrameLoaderTypes.h" 34 34 #include "IconURL.h" 35 #include "LayoutMilestones.h" 35 36 #include <wtf/Forward.h> 36 37 #include <wtf/Vector.h> … … 163 164 virtual void dispatchDidFinishLoad() = 0; 164 165 165 virtual void dispatchDidFirstLayout() = 0;166 virtual void dispatchDidFirstVisuallyNonEmptyLayout() = 0;167 virtual void dispatchDidNewFirstVisuallyNonEmptyLayout() { }168 166 virtual void dispatchDidLayout() { } 167 virtual void dispatchDidLayout(LayoutMilestones) { } 169 168 170 169 virtual Frame* dispatchCreatePage(const NavigationAction&) = 0; -
trunk/Source/WebCore/page/FrameView.cpp
r128570 r129545 2433 2433 m_frame->selection()->updateAppearance(); 2434 2434 2435 LayoutMilestones milestonesOfInterest = 0; 2436 LayoutMilestones milestonesAchieved = 0; 2437 Page* page = m_frame->page(); 2438 if (page) 2439 milestonesOfInterest = page->layoutMilestones(); 2440 2435 2441 if (m_nestedLayoutCount <= 1) { 2436 2442 if (m_firstLayoutCallbackPending) { 2437 2443 m_firstLayoutCallbackPending = false; 2438 m_frame->loader()->didFirstLayout(); 2439 if (Page* page = m_frame->page()) { 2444 if (milestonesOfInterest & DidFirstLayout) 2445 milestonesAchieved |= DidFirstLayout; 2446 if (page) { 2440 2447 if (page->mainFrame() == m_frame) 2441 2448 page->startCountingRelevantRepaintedObjects(); … … 2450 2457 if (m_isVisuallyNonEmpty && !m_frame->document()->didLayoutWithPendingStylesheets() && m_firstVisuallyNonEmptyLayoutCallbackPending) { 2451 2458 m_firstVisuallyNonEmptyLayoutCallbackPending = false; 2452 m_frame->loader()->didFirstVisuallyNonEmptyLayout(); 2453 } 2454 } 2455 2459 if (milestonesOfInterest & DidFirstVisuallyNonEmptyLayout) 2460 milestonesAchieved |= DidFirstVisuallyNonEmptyLayout; 2461 } 2462 } 2463 2464 m_frame->loader()->didLayout(milestonesAchieved); 2465 2466 // FIXME: We should consider adding DidLayout as a LayoutMilestone. That would let us merge this 2467 // with didLayout(LayoutMilestones). 2456 2468 m_frame->loader()->client()->dispatchDidLayout(); 2457 2469 … … 2465 2477 } 2466 2478 2467 if ( Page* page = m_frame->page()) {2479 if (page) { 2468 2480 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) 2469 2481 scrollingCoordinator->frameViewLayoutUpdated(this); … … 2494 2506 #if ENABLE(INSPECTOR) 2495 2507 if (InspectorInstrumentation::hasFrontends()) { 2496 if ( Page* page = m_frame->page()) {2508 if (page) { 2497 2509 if (page->mainFrame() == m_frame) { 2498 2510 if (InspectorClient* inspectorClient = page->inspectorController()->inspectorClient()) -
trunk/Source/WebCore/page/Page.cpp
r129423 r129545 163 163 #endif 164 164 , m_displayID(0) 165 , m_layoutMilestones(0) 165 166 , m_isCountingRelevantRepaintedObjects(false) 166 167 #ifndef NDEBUG … … 1116 1117 #endif 1117 1118 1118 // FIXME: gPaintedObjectCounterThreshold is no longer used for calculating relevant repainted areas, 1119 // and it should be removed. For the time being, it is useful because it allows us to avoid doing 1120 // any of this work for ports that don't make sure of didNewFirstVisuallyNonEmptyLayout. We should 1121 // remove this when we resolve <rdar://problem/10791680> Need to merge didFirstVisuallyNonEmptyLayout 1122 // and didNewFirstVisuallyNonEmptyLayout 1123 static uint64_t gPaintedObjectCounterThreshold = 0; 1119 void Page::addLayoutMilestones(LayoutMilestones milestones) 1120 { 1121 // In the future, we may want a function that replaces m_layoutMilestones instead of just adding to it. 1122 m_layoutMilestones |= milestones; 1123 } 1124 1124 1125 1125 // These are magical constants that might be tweaked over time. … … 1127 1127 static double gMaximumUnpaintedAreaRatio = 0.04; 1128 1128 1129 void Page::setRelevantRepaintedObjectsCounterThreshold(uint64_t threshold)1130 {1131 gPaintedObjectCounterThreshold = threshold;1132 }1133 1134 1129 bool Page::isCountingRelevantRepaintedObjects() const 1135 1130 { 1136 return m_isCountingRelevantRepaintedObjects && gPaintedObjectCounterThreshold > 0;1131 return m_isCountingRelevantRepaintedObjects && (m_layoutMilestones & DidHitRelevantRepaintedObjectsAreaThreshold); 1137 1132 } 1138 1133 … … 1188 1183 resetRelevantPaintedObjectCounter(); 1189 1184 if (Frame* frame = mainFrame()) 1190 frame->loader()->did NewFirstVisuallyNonEmptyLayout();1185 frame->loader()->didLayout(DidHitRelevantRepaintedObjectsAreaThreshold); 1191 1186 } 1192 1187 } -
trunk/Source/WebCore/page/Page.h
r128788 r129545 25 25 #include "FrameLoaderTypes.h" 26 26 #include "FindOptions.h" 27 #include "LayoutMilestones.h" 27 28 #include "LayoutTypes.h" 28 29 #include "PageVisibilityState.h" … … 327 328 PlatformDisplayID displayID() const { return m_displayID; } 328 329 330 void addLayoutMilestones(LayoutMilestones); 331 LayoutMilestones layoutMilestones() const { return m_layoutMilestones; } 332 329 333 bool isCountingRelevantRepaintedObjects() const; 330 void setRelevantRepaintedObjectsCounterThreshold(uint64_t);331 334 void startCountingRelevantRepaintedObjects(); 332 335 void resetRelevantPaintedObjectCounter(); … … 447 450 #endif 448 451 PlatformDisplayID m_displayID; 452 453 LayoutMilestones m_layoutMilestones; 449 454 450 455 HashSet<RenderObject*> m_relevantUnpaintedRenderObjects; -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r129419 r129545 556 556 m_webSettings->setUserAgentString(defaultUserAgent()); 557 557 m_page->setDeviceScaleFactor(m_webSettings->devicePixelRatio()); 558 559 m_page->addLayoutMilestones(DidFirstVisuallyNonEmptyLayout); 558 560 559 561 #if USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebKit/blackberry/ChangeLog
r129544 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestoneOptions) 15 * WebCoreSupport/FrameLoaderClientBlackBerry.cpp: 16 (WebCore::FrameLoaderClientBlackBerry::dispatchDidLayout): 17 * WebCoreSupport/FrameLoaderClientBlackBerry.h: 18 (FrameLoaderClientBlackBerry): 19 20 It is now necessary to opt into getting any of the 21 "layout milestone" notifications. 22 * Api/WebPage.cpp: 23 (BlackBerry::WebKit::WebPagePrivate::init): 24 1 25 2012-09-25 Mike Fenton <mifenton@rim.com> 2 26 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
r129087 r129545 849 849 } 850 850 851 void FrameLoaderClientBlackBerry::dispatchDid FirstVisuallyNonEmptyLayout()851 void FrameLoaderClientBlackBerry::dispatchDidLayout(LayoutMilestones milestones) 852 852 { 853 853 if (!isMainFrame()) 854 854 return; 855 855 856 BlackBerry::Platform::log(BlackBerry::Platform::LogLevelInfo, "dispatchDidFirstVisuallyNonEmptyLayout"); 857 858 readyToRender(true); 859 860 // For FrameLoadTypeSame or FrameLoadTypeStandard load, the layout timer can be fired which can call 861 // dispatchDidFirstVisuallyNonEmptyLayout() after the load Finished state, in which case the web page 862 // will have no chance to zoom to initial scale. So we should give it a chance, otherwise the scale of 863 // the web page can be incorrect. 864 FrameLoadType frameLoadType = m_frame->loader()->loadType(); 865 if (m_webPagePrivate->loadState() == WebPagePrivate::Finished && (frameLoadType == FrameLoadTypeSame || frameLoadType == FrameLoadTypeStandard)) 866 m_webPagePrivate->setShouldZoomToInitialScaleAfterLoadFinished(true); 867 868 if (m_webPagePrivate->shouldZoomToInitialScaleOnLoad()) { 869 BackingStorePrivate* backingStorePrivate = m_webPagePrivate->m_backingStore->d; 870 m_webPagePrivate->zoomToInitialScaleOnLoad(); // Set the proper zoom level first. 871 backingStorePrivate->clearVisibleZoom(); // Clear the visible zoom since we're explicitly rendering+blitting below. 872 if (backingStorePrivate->renderVisibleContents()) { 873 if (!backingStorePrivate->shouldDirectRenderingToWindow()) 874 backingStorePrivate->blitVisibleContents(); 875 m_webPagePrivate->m_client->notifyContentRendered(backingStorePrivate->visibleContentsRect()); 856 if (milestones & DidFirstVisuallyNonEmptyLayout) { 857 BlackBerry::Platform::log(BlackBerry::Platform::LogLevelInfo, "dispatchDidFirstVisuallyNonEmptyLayout"); 858 859 readyToRender(true); 860 861 // For FrameLoadTypeSame or FrameLoadTypeStandard load, the layout timer can be fired which can call 862 // dispatchDidFirstVisuallyNonEmptyLayout() after the load Finished state, in which case the web page 863 // will have no chance to zoom to initial scale. So we should give it a chance, otherwise the scale of 864 // the web page can be incorrect. 865 FrameLoadType frameLoadType = m_frame->loader()->loadType(); 866 if (m_webPagePrivate->loadState() == WebPagePrivate::Finished && (frameLoadType == FrameLoadTypeSame || frameLoadType == FrameLoadTypeStandard)) 867 m_webPagePrivate->setShouldZoomToInitialScaleAfterLoadFinished(true); 868 869 if (m_webPagePrivate->shouldZoomToInitialScaleOnLoad()) { 870 BackingStorePrivate* backingStorePrivate = m_webPagePrivate->m_backingStore->d; 871 m_webPagePrivate->zoomToInitialScaleOnLoad(); // Set the proper zoom level first. 872 backingStorePrivate->clearVisibleZoom(); // Clear the visible zoom since we're explicitly rendering+blitting below. 873 if (backingStorePrivate->renderVisibleContents()) { 874 if (!backingStorePrivate->shouldDirectRenderingToWindow()) 875 backingStorePrivate->blitVisibleContents(); 876 m_webPagePrivate->m_client->notifyContentRendered(backingStorePrivate->visibleContentsRect()); 877 } 876 878 } 877 } 878 879 m_webPagePrivate->m_client->notifyFirstVisuallyNonEmptyLayout();879 880 m_webPagePrivate->m_client->notifyFirstVisuallyNonEmptyLayout(); 881 } 880 882 } 881 883 -
trunk/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
r129087 r129545 83 83 virtual void dispatchDidFinishDocumentLoad(); 84 84 virtual void dispatchDidFinishLoad(); 85 virtual void dispatchDidFirstLayout() { notImplemented(); } 86 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 85 virtual void dispatchDidLayout(LayoutMilestones); 87 86 virtual Frame* dispatchCreatePage(const NavigationAction&); 88 87 virtual void dispatchShow() { notImplemented(); } -
trunk/Source/WebKit/chromium/ChangeLog
r129534 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestoneOptions) 15 * src/FrameLoaderClientImpl.cpp: 16 (WebKit::FrameLoaderClientImpl::dispatchDidLayout): 17 * src/FrameLoaderClientImpl.h: 18 (FrameLoaderClientImpl): 19 20 It is now necessary to opt into getting any of the 21 "layout milestone" notifications. 22 * src/WebHelperPluginImpl.cpp: 23 (WebKit::WebHelperPluginImpl::initPage): 24 * src/WebPagePopupImpl.cpp: 25 (WebKit::WebPagePopupImpl::initPage): 26 * src/WebViewImpl.cpp: 27 (WebKit::WebViewImpl::WebViewImpl): 28 1 29 2012-09-25 Joshua Bell <jsbell@chromium.org> 2 30 -
trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
r129020 r129545 868 868 } 869 869 870 void FrameLoaderClientImpl::dispatchDidFirstLayout() 871 { 872 if (m_webFrame->client()) 870 void FrameLoaderClientImpl::dispatchDidLayout(LayoutMilestones milestones) 871 { 872 if (!m_webFrame->client()) 873 return; 874 875 if (milestones & DidFirstLayout) 873 876 m_webFrame->client()->didFirstLayout(m_webFrame); 874 } 875 876 void FrameLoaderClientImpl::dispatchDidFirstVisuallyNonEmptyLayout() 877 { 878 if (m_webFrame->client()) 877 if (milestones & DidFirstVisuallyNonEmptyLayout) 879 878 m_webFrame->client()->didFirstVisuallyNonEmptyLayout(m_webFrame); 880 879 } -
trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
r129020 r129545 111 111 virtual void dispatchDidFinishDocumentLoad(); 112 112 virtual void dispatchDidFinishLoad(); 113 virtual void dispatchDidFirstLayout(); 114 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 113 virtual void dispatchDidLayout(WebCore::LayoutMilestones); 115 114 virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&); 116 115 virtual void dispatchShow(); -
trunk/Source/WebKit/chromium/src/WebHelperPluginImpl.cpp
r119988 r129545 185 185 m_page->settings()->setPluginsEnabled(true); 186 186 187 unsigned layoutMilestones = DidFirstLayout | DidFirstVisuallyNonEmptyLayout; 188 m_page->addLayoutMilestones(static_cast<LayoutMilestones>(layoutMilestones)); 189 187 190 webView->client()->initializeHelperPluginWebFrame(this); 188 191 -
trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
r126940 r129545 183 183 m_page->settings()->setDeviceSupportsTouch(m_webView->page()->settings()->deviceSupportsTouch()); 184 184 185 unsigned layoutMilestones = DidFirstLayout | DidFirstVisuallyNonEmptyLayout; 186 m_page->addLayoutMilestones(static_cast<LayoutMilestones>(layoutMilestones)); 187 185 188 static ContextFeaturesClient* pagePopupFeaturesClient = new PagePopupFeaturesClient(); 186 189 provideContextFeaturesTo(m_page.get(), pagePopupFeaturesClient); -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r129511 r129545 484 484 m_page->setGroupName(pageGroupName); 485 485 486 unsigned layoutMilestones = DidFirstLayout | DidFirstVisuallyNonEmptyLayout; 487 m_page->addLayoutMilestones(static_cast<LayoutMilestones>(layoutMilestones)); 488 486 489 #if ENABLE(PAGE_VISIBILITY_API) 487 490 if (m_client) -
trunk/Source/WebKit/efl/ChangeLog
r129395 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestoneOptions) 15 * WebCoreSupport/FrameLoaderClientEfl.cpp: 16 (WebCore::FrameLoaderClientEfl::dispatchDidLayout): 17 * WebCoreSupport/FrameLoaderClientEfl.h: 18 (FrameLoaderClientEfl): 19 20 It is now necessary to opt into getting any of the 21 "layout milestone" notifications. 22 * ewk/ewk_view.cpp: 23 (_ewk_view_priv_new): 24 1 25 2012-09-24 Dominik Röttsches <dominik.rottsches@intel.com> 2 26 -
trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
r129319 r129545 679 679 } 680 680 681 void FrameLoaderClientEfl::dispatchDidFirstLayout() 682 { 683 ewk_frame_load_firstlayout_finished(m_frame); 684 } 685 686 void FrameLoaderClientEfl::dispatchDidFirstVisuallyNonEmptyLayout() 687 { 688 ewk_frame_load_firstlayout_nonempty_finished(m_frame); 681 void FrameLoaderClientEfl::dispatchDidLayout(LayoutMilestones milestones) 682 { 683 if (milestones & DidFirstLayout) 684 ewk_frame_load_firstlayout_finished(m_frame); 685 if (milestones & DidFirstVisuallyNonEmptyLayout) 686 ewk_frame_load_firstlayout_nonempty_finished(m_frame); 689 687 } 690 688 -
trunk/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
r127244 r129545 107 107 virtual void dispatchDidFinishDocumentLoad(); 108 108 virtual void dispatchDidFinishLoad(); 109 virtual void dispatchDidFirstLayout(); 110 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 109 virtual void dispatchDidLayout(LayoutMilestones); 111 110 112 111 virtual Frame* dispatchCreatePage(const WebCore::NavigationAction&); -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r129395 r129545 778 778 priv->pageSettings = priv->page->settings(); 779 779 780 WebCore::LayoutMilestones layoutMilestones = WebCore::DidFirstLayout | WebCore::DidFirstVisuallyNonEmptyLayout; 781 priv->page->addLayoutMilestones(layoutMilestones); 782 780 783 priv->viewportArguments.width = WebCore::ViewportArguments::ValueAuto; 781 784 priv->viewportArguments.height = WebCore::ViewportArguments::ValueAuto; -
trunk/Source/WebKit/gtk/ChangeLog
r129537 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestoneOptions) 15 * WebCoreSupport/FrameLoaderClientGtk.cpp: 16 (WebKit::FrameLoaderClient::dispatchDidLayout): 17 * WebCoreSupport/FrameLoaderClientGtk.h: 18 (FrameLoaderClient): 19 20 It is now necessary to opt into getting any of the 21 "layout milestone" notifications. 22 * webkit/webkitwebview.cpp: 23 (webkit_web_view_init): 24 1 25 2012-09-25 Paweł Forysiuk <tuxator@o2.pl> 2 26 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r125500 r129545 852 852 } 853 853 854 void FrameLoaderClient::dispatchDidFirstLayout() 855 { 856 notImplemented(); 857 } 858 859 void FrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() 854 void FrameLoaderClient::dispatchDidLayout(LayoutMilestones milestones) 860 855 { 861 856 if (m_loadingErrorPage) 862 857 return; 863 858 864 notifyStatus(m_frame, WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT); 859 if (milestones & DidFirstVisuallyNonEmptyLayout) 860 notifyStatus(m_frame, WEBKIT_LOAD_FIRST_VISUALLY_NON_EMPTY_LAYOUT); 865 861 } 866 862 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
r116121 r129545 90 90 virtual void dispatchDidFinishDocumentLoad(); 91 91 virtual void dispatchDidFinishLoad(); 92 virtual void dispatchDidFirstLayout(); 93 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 92 virtual void dispatchDidLayout(WebCore::LayoutMilestones); 94 93 95 94 virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&); -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r129000 r129545 3629 3629 priv->corePage = new Page(pageClients); 3630 3630 3631 priv->corePage->addLayoutMilestones(DidFirstVisuallyNonEmptyLayout); 3632 3631 3633 #if ENABLE(GEOLOCATION) 3632 3634 if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) { -
trunk/Source/WebKit/mac/ChangeLog
r129444 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 The new API has two parts. First, the client has to opt into which 12 layout milestones they are interested in hearing about using 13 [WebView _layoutMilestones]. Then, WebKit will call 14 the WebFrameLoader delegate's didLayout(WebLayoutMilestones) 15 callback when the specified layout milestones have fired. 16 didLayout takes the WebLayoutMilestones bit mask, which will 17 indicate which milestones have fired since it is possible for two 18 to fire at the same time. 19 20 Remove dispatchDidFirstLayout, 21 dispatchDidFirstVisuallyNonEmptyLayout, and 22 dispatchDidNewFirstVisuallyNonEmptyLayout. They are now replaced 23 by dispatchDidLayout(LayoutMilestones) 24 * WebCoreSupport/WebFrameLoaderClient.h: 25 (WebFrameLoaderClient): 26 * WebCoreSupport/WebFrameLoaderClient.mm: 27 (WebFrameLoaderClient::dispatchDidLayout): 28 29 Add new function to the delegate for didLayout. 30 * WebView/WebDelegateImplementationCaching.h: 31 (WebFrameLoadDelegateImplementationCache): 32 33 We need a delegate template that takes an NSUInteger. 34 * WebView/WebDelegateImplementationCaching.mm: 35 (CallDelegate): 36 (CallFrameLoadDelegate): 37 38 Convert between WebCore and WebKit versions of the bit mask. 39 * WebView/WebView.mm: 40 (coreLayoutMilestones): 41 (kitLayoutMilestones): 42 43 Add new delegate, and set the appropriate layout milestones in 44 WebCore based on old delegates having implementations. 45 (-[WebView _cacheFrameLoadDelegateImplementations]): 46 47 Call into WebCore. 48 (-[WebView _listenForLayoutMilestones:]): 49 (-[WebView _layoutMilestones]): 50 * WebView/WebViewInternal.h: 51 * WebView/WebViewPrivate.h: 52 1 53 2012-09-24 Benjamin Poulain <bpoulain@apple.com> 2 54 -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
r128129 r129545 109 109 virtual void dispatchDidFinishDocumentLoad() OVERRIDE; 110 110 virtual void dispatchDidFinishLoad() OVERRIDE; 111 virtual void dispatchDidFirstLayout() OVERRIDE; 112 virtual void dispatchDidFirstVisuallyNonEmptyLayout() OVERRIDE; 111 virtual void dispatchDidLayout(WebCore::LayoutMilestones) OVERRIDE; 113 112 114 113 virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&) OVERRIDE; -
trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
r128403 r129545 663 663 } 664 664 665 void WebFrameLoaderClient::dispatchDid FirstLayout()665 void WebFrameLoaderClient::dispatchDidLayout(LayoutMilestones milestones) 666 666 { 667 667 WebView *webView = getWebView(m_webFrame.get()); 668 668 WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); 669 if (implementations->didFirstLayoutInFrameFunc) 670 CallFrameLoadDelegate(implementations->didFirstLayoutInFrameFunc, webView, @selector(webView:didFirstLayoutInFrame:), m_webFrame.get()); 671 672 // See WebFrameLoaderClient::provisionalLoadStarted. 673 WebDynamicScrollBarsView *scrollView = [m_webFrame->_private->webFrameView _scrollView]; 674 if ([getWebView(m_webFrame.get()) drawsBackground]) 675 [scrollView setDrawsBackground:YES]; 669 670 if (implementations->didLayoutFunc) 671 CallFrameLoadDelegate(implementations->didLayoutFunc, webView, @selector(webView:didLayout:), kitLayoutMilestones(milestones)); 672 673 if (milestones & DidFirstLayout) { 674 // FIXME: We should consider removing the old didFirstLayout API since this is doing double duty with the 675 // new didLayout API. 676 if (implementations->didFirstLayoutInFrameFunc) 677 CallFrameLoadDelegate(implementations->didFirstLayoutInFrameFunc, webView, @selector(webView:didFirstLayoutInFrame:), m_webFrame.get()); 678 679 // See WebFrameLoaderClient::provisionalLoadStarted. 680 WebDynamicScrollBarsView *scrollView = [m_webFrame->_private->webFrameView _scrollView]; 681 if ([getWebView(m_webFrame.get()) drawsBackground]) 682 [scrollView setDrawsBackground:YES]; 676 683 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 677 [scrollView setVerticalScrollElasticity:NSScrollElasticityAutomatic];678 [scrollView setHorizontalScrollElasticity:NSScrollElasticityAutomatic];684 [scrollView setVerticalScrollElasticity:NSScrollElasticityAutomatic]; 685 [scrollView setHorizontalScrollElasticity:NSScrollElasticityAutomatic]; 679 686 #endif 680 }681 682 void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() 683 { 684 WebView *webView = getWebView(m_webFrame.get());685 WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView);686 if (implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc)687 CallFrameLoadDelegate(implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc, webView, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:), m_webFrame.get());687 } 688 689 if (milestones & DidFirstVisuallyNonEmptyLayout) { 690 // FIXME: We should consider removing the old didFirstVisuallyNonEmptyLayoutForFrame API since this is doing 691 // double duty with the new didLayout API. 692 if (implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc) 693 CallFrameLoadDelegate(implementations->didFirstVisuallyNonEmptyLayoutInFrameFunc, webView, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:), m_webFrame.get()); 694 } 688 695 } 689 696 -
trunk/Source/WebKit/mac/WebView/WebDelegateImplementationCaching.h
r128129 r129545 74 74 IMP didFirstLayoutInFrameFunc; 75 75 IMP didFirstVisuallyNonEmptyLayoutInFrameFunc; 76 IMP didLayoutFunc; 76 77 IMP didReceiveIconForFrameFunc; 77 78 IMP didFinishDocumentLoadForFrameFunc; … … 124 125 125 126 id CallFrameLoadDelegate(IMP, WebView *, SEL); 127 id CallFrameLoadDelegate(IMP, WebView *, SEL, NSUInteger); 126 128 id CallFrameLoadDelegate(IMP, WebView *, SEL, id); 127 129 id CallFrameLoadDelegate(IMP, WebView *, SEL, id, id); -
trunk/Source/WebKit/mac/WebView/WebDelegateImplementationCaching.mm
r128129 r129545 249 249 } 250 250 251 static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, NSUInteger integer) 252 { 253 if (!delegate) 254 return nil; 255 @try { 256 return implementation(delegate, selector, self, integer); 257 } @catch(id exception) { 258 ReportDiscardedDelegateException(selector, exception); 259 } 260 return nil; 261 } 262 251 263 static inline id CallDelegate(IMP implementation, WebView *self, id delegate, SEL selector, id object) 252 264 { … … 451 463 } 452 464 465 id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector, NSUInteger integer) 466 { 467 return CallDelegate(implementation, self, self->_private->frameLoadDelegate, selector, integer); 468 } 469 453 470 id CallFrameLoadDelegate(IMP implementation, WebView *self, SEL selector, id object) 454 471 { -
trunk/Source/WebKit/mac/WebView/WebView.mm
r129444 r129545 393 393 } 394 394 395 LayoutMilestones coreLayoutMilestones(WebLayoutMilestones milestones) 396 { 397 return (milestones & WebDidFirstLayout ? DidFirstLayout : 0) 398 | (milestones & WebDidFirstVisuallyNonEmptyLayout ? DidFirstVisuallyNonEmptyLayout : 0) 399 | (milestones & WebDidHitRelevantRepaintedObjectsAreaThreshold ? DidHitRelevantRepaintedObjectsAreaThreshold : 0); 400 } 401 402 WebLayoutMilestones kitLayoutMilestones(LayoutMilestones milestones) 403 { 404 return (milestones & DidFirstLayout ? WebDidFirstLayout : 0) 405 | (milestones & DidFirstVisuallyNonEmptyLayout ? WebDidFirstVisuallyNonEmptyLayout : 0) 406 | (milestones & DidHitRelevantRepaintedObjectsAreaThreshold ? WebDidHitRelevantRepaintedObjectsAreaThreshold : 0); 407 } 408 395 409 @interface WebView (WebFileInternal) 396 410 - (float)_deviceScaleFactor; … … 1624 1638 cache->didFirstLayoutInFrameFunc = getMethod(delegate, @selector(webView:didFirstLayoutInFrame:)); 1625 1639 cache->didFirstVisuallyNonEmptyLayoutInFrameFunc = getMethod(delegate, @selector(webView:didFirstVisuallyNonEmptyLayoutInFrame:)); 1640 cache->didLayoutFunc = getMethod(delegate, @selector(webView:didLayout:)); 1626 1641 cache->didHandleOnloadEventsForFrameFunc = getMethod(delegate, @selector(webView:didHandleOnloadEventsForFrame:)); 1627 1642 cache->didReceiveIconForFrameFunc = getMethod(delegate, @selector(webView:didReceiveIcon:forFrame:)); … … 1635 1650 cache->didRunInsecureContentFunc = getMethod(delegate, @selector(webView:didRunInsecureContent:)); 1636 1651 cache->didDetectXSSFunc = getMethod(delegate, @selector(webView:didDetectXSS:)); 1652 1653 // It would be nice to get rid of this code and transition all clients to using didLayout instead of 1654 // didFirstLayoutInFrame and didFirstVisuallyNonEmptyLayoutInFrame. In the meantime, this is required 1655 // for backwards compatibility. 1656 Page* page = core(self); 1657 if (page) { 1658 unsigned milestones = 0; 1659 if (cache->didFirstLayoutInFrameFunc) 1660 milestones |= DidFirstLayout; 1661 if (cache->didFirstVisuallyNonEmptyLayoutInFrameFunc) 1662 milestones |= DidFirstVisuallyNonEmptyLayout; 1663 page->addLayoutMilestones(static_cast<LayoutMilestones>(milestones)); 1664 } 1637 1665 } 1638 1666 … … 2862 2890 ASSERT_NOT_REACHED(); 2863 2891 return WebPaginationModeUnpaginated; 2892 } 2893 2894 - (void)_listenForLayoutMilestones:(WebLayoutMilestones)layoutMilestones 2895 { 2896 Page* page = core(self); 2897 if (!page) 2898 return; 2899 2900 page->addLayoutMilestones(coreLayoutMilestones(layoutMilestones)); 2901 } 2902 2903 - (WebLayoutMilestones)_layoutMilestones 2904 { 2905 Page* page = core(self); 2906 if (!page) 2907 return 0; 2908 2909 return kitLayoutMilestones(page->layoutMilestones()); 2864 2910 } 2865 2911 -
trunk/Source/WebKit/mac/WebView/WebViewInternal.h
r120357 r129545 38 38 #import <WebCore/FindOptions.h> 39 39 #import <WebCore/FloatRect.h> 40 #import <WebCore/LayoutMilestones.h> 40 41 #import <WebCore/TextAlternativeWithRange.h> 41 42 #import <WebCore/WebCoreKeyboardUIMode.h> … … 65 66 66 67 WebCore::FindOptions coreOptions(WebFindOptions options); 68 69 WebCore::LayoutMilestones coreLayoutMilestones(WebLayoutMilestones); 70 WebLayoutMilestones kitLayoutMilestones(WebCore::LayoutMilestones); 67 71 68 72 #if USE(DICTATION_ALTERNATIVES) -
trunk/Source/WebKit/mac/WebView/WebViewPrivate.h
r129444 r129545 109 109 } WebPaginationMode; 110 110 111 enum { 112 WebDidFirstLayout = 1 << 0, 113 WebDidFirstVisuallyNonEmptyLayout = 1 << 1, 114 WebDidHitRelevantRepaintedObjectsAreaThreshold = 1 << 2 115 }; 116 typedef NSUInteger WebLayoutMilestones; 117 111 118 // This needs to be in sync with WebCore::NotificationClient::Permission 112 119 typedef enum { … … 566 573 - (void)_setPaginationMode:(WebPaginationMode)paginationMode; 567 574 - (WebPaginationMode)_paginationMode; 575 576 - (void)_listenForLayoutMilestones:(WebLayoutMilestones)layoutMilestones; 577 - (WebLayoutMilestones)_layoutMilestones; 568 578 569 579 // Whether the column-break-{before,after} properties are respected instead of the … … 760 770 - (void)webView:(WebView *)sender didFirstVisuallyNonEmptyLayoutInFrame:(WebFrame *)frame; 761 771 772 - (void)webView:(WebView *)sender didLayout:(WebLayoutMilestones)milestones; 773 762 774 // For implementing the WebInspector's test harness 763 775 - (void)webView:(WebView *)webView didClearInspectorWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame; -
trunk/Source/WebKit/qt/Api/qwebpage.cpp
r128472 r129545 358 358 // as expected out of the box, we use a default group similar to what other ports are doing. 359 359 page->setGroupName("Default Group"); 360 361 page->addLayoutMilestones(DidFirstVisuallyNonEmptyLayout); 360 362 361 363 settings = new QWebSettings(page->settings()); -
trunk/Source/WebKit/qt/ChangeLog
r129506 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestoneOptions) 15 * WebCoreSupport/FrameLoaderClientQt.cpp: 16 (WebCore::FrameLoaderClientQt::dispatchDidLayout): 17 * WebCoreSupport/FrameLoaderClientQt.h: 18 (FrameLoaderClientQt): 19 20 It is now necessary to opt into getting any of the 21 "layout milestone" notifications. 22 * Api/qwebpage.cpp: 23 (QWebPagePrivate::QWebPagePrivate): 24 1 25 2012-09-25 Simon Hausmann <simon.hausmann@digia.com> 2 26 -
trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
r128403 r129545 528 528 } 529 529 530 531 void FrameLoaderClientQt::dispatchDidFirstLayout() 532 { 533 } 534 535 void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout() 536 { 537 if (m_webFrame) 530 void FrameLoaderClientQt::dispatchDidLayout(LayoutMilestones milestones) 531 { 532 if (!m_webFrame) 533 return; 534 535 if (milestones & DidFirstVisuallyNonEmptyLayout) 538 536 emit m_webFrame->initialLayoutCompleted(); 539 537 } -
trunk/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
r125603 r129545 124 124 virtual void dispatchDidFinishDocumentLoad(); 125 125 virtual void dispatchDidFinishLoad(); 126 virtual void dispatchDidFirstLayout(); 127 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 126 virtual void dispatchDidLayout(WebCore::LayoutMilestones); 128 127 129 128 virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&); -
trunk/Source/WebKit/win/ChangeLog
r128988 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestoneOptions) 15 * WebCoreSupport/WebFrameLoaderClient.cpp: 16 (WebFrameLoaderClient::dispatchDidLayout): 17 * WebCoreSupport/WebFrameLoaderClient.h: 18 (WebFrameLoaderClient): 19 20 It is now necessary to opt into getting any of the 21 "layout milestone" notifications. 22 * WebView.cpp: 23 (WebView::initWithFrame): 24 1 25 2012-09-19 Patrick Gansterer <paroga@webkit.org> 2 26 -
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
r125500 r129545 417 417 } 418 418 419 void WebFrameLoaderClient::dispatchDidFirstLayout() 420 { 421 WebView* webView = m_webFrame->webView(); 422 COMPtr<IWebFrameLoadDelegatePrivate> frameLoadDelegatePriv; 423 if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePriv)) && frameLoadDelegatePriv) 424 frameLoadDelegatePriv->didFirstLayoutInFrame(webView, m_webFrame); 425 } 426 427 void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() 419 void WebFrameLoaderClient::dispatchDidLayout(LayoutMilestones milestones) 428 420 { 429 421 WebView* webView = m_webFrame->webView(); 430 422 COMPtr<IWebFrameLoadDelegatePrivate> frameLoadDelegatePrivate; 431 if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePrivate)) && frameLoadDelegatePrivate) 432 frameLoadDelegatePrivate->didFirstVisuallyNonEmptyLayoutInFrame(webView, m_webFrame); 423 424 if (milestones & DidFirstLayout) { 425 if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePrivate)) && frameLoadDelegatePrivate) 426 frameLoadDelegatePrivate->didFirstLayoutInFrame(webView, m_webFrame); 427 } 428 429 if (milestones & DidFirstVisuallyNonEmptyLayout) { 430 if (SUCCEEDED(webView->frameLoadDelegatePrivate(&frameLoadDelegatePrivate)) && frameLoadDelegatePrivate) 431 frameLoadDelegatePrivate->didFirstVisuallyNonEmptyLayoutInFrame(webView, m_webFrame); 432 } 433 433 } 434 434 -
trunk/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
r112474 r129545 75 75 virtual void dispatchDidFinishDocumentLoad(); 76 76 virtual void dispatchDidFinishLoad(); 77 virtual void dispatchDidFirstLayout(); 78 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 77 virtual void dispatchDidLayout(WebCore::LayoutMilestones); 79 78 80 79 virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&); -
trunk/Source/WebKit/win/WebView.cpp
r128988 r129545 2692 2692 provideGeolocationTo(m_page, new WebGeolocationClient(this)); 2693 2693 2694 unsigned layoutMilestones = DidFirstLayout | DidFirstVisuallyNonEmptyLayout; 2695 m_page->addLayoutMilestones(static_cast<LayoutMilestones>(layoutMilestones)); 2696 2694 2697 BString localStoragePath; 2695 2698 if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) -
trunk/Source/WebKit/wince/ChangeLog
r126926 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestones) 15 * WebCoreSupport/FrameLoaderClientWinCE.cpp: 16 (WebKit::FrameLoaderClientWinCE::dispatchDidLayout): 17 * WebCoreSupport/FrameLoaderClientWinCE.h: 18 (FrameLoaderClientWinCE): 19 1 20 2012-08-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 21 -
trunk/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
r125500 r129545 377 377 } 378 378 379 void FrameLoaderClientWinCE::dispatchDidFirstLayout() 380 { 381 notImplemented(); 382 } 383 384 void FrameLoaderClientWinCE::dispatchDidFirstVisuallyNonEmptyLayout() 379 void FrameLoaderClientWinCE::dispatchDidLayout(LayoutMilestones) 385 380 { 386 381 notImplemented(); -
trunk/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
r115926 r129545 84 84 virtual void dispatchDidFinishDocumentLoad(); 85 85 virtual void dispatchDidFinishLoad(); 86 virtual void dispatchDidFirstLayout(); 87 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 86 virtual void dispatchDidLayout(WebCore::LayoutMilestones); 88 87 89 88 virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&); -
trunk/Source/WebKit/wx/ChangeLog
r128403 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Remove dispatchDidFirstLayout, 12 dispatchDidFirstVisuallyNonEmptyLayout, and 13 dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality 14 is now replaced by dispatchDidLayout(LayoutMilestones) 15 * WebKitSupport/FrameLoaderClientWx.cpp: 16 (WebCore::FrameLoaderClientWx::dispatchDidLayout): 17 * WebKitSupport/FrameLoaderClientWx.h: 18 (FrameLoaderClientWx): 19 1 20 2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 21 -
trunk/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
r127757 r129545 355 355 } 356 356 357 358 void FrameLoaderClientWx::dispatchDidFirstLayout() 359 { 360 notImplemented(); 361 } 362 363 void FrameLoaderClientWx::dispatchDidFirstVisuallyNonEmptyLayout() 357 void FrameLoaderClientWx::dispatchDidLayout(LayoutMilestones) 364 358 { 365 359 notImplemented(); -
trunk/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
r116121 r129545 115 115 virtual void dispatchDidFinishDocumentLoad(); 116 116 virtual void dispatchDidFinishLoad(); 117 virtual void dispatchDidFirstLayout(); 118 virtual void dispatchDidFirstVisuallyNonEmptyLayout(); 117 virtual void dispatchDidLayout(WebCore::LayoutMilestones); 119 118 virtual void dispatchDidChangeIcons(WebCore::IconType); 120 119 -
trunk/Source/WebKit2/ChangeLog
r129541 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 The new API has two parts. First, the client has to opt into which 12 layout milestones they are interested in hearing about using 13 WKPageListenForLayoutMilestones or 14 WKBundlePageListenForLayoutMilestones(). Then, WebKit will call 15 the didLayout(WKLayoutMilestones) callback on the appropriate 16 clients when the specified layout milestones have fired. didLayout 17 takes the WKLayoutMilestones bit mask, which will indicate which 18 milestones have fired since it is possible for two to fire at the 19 same time. 20 21 Define WKLayoutMilestoneOptions. 22 * Shared/API/c/WKPageLoadTypes.h: 23 24 Define conversions between WKLayoutMilestoneOptions and 25 WebCore::LayoutMilestoneOptions 26 * Shared/API/c/WKSharedAPICast.h: 27 (WebKit::toWKLayoutMilestoneOptions): 28 (WebKit): 29 (WebKit::toLayoutMilestoneOptions): 30 31 New API. 32 * UIProcess/API/C/WKPage.cpp: 33 (WKPageListenForLayoutMilestones): 34 * UIProcess/API/C/WKPage.h: 35 * UIProcess/WebLoaderClient.cpp: 36 (WebKit::WebLoaderClient::didLayout): 37 (WebKit): 38 * UIProcess/WebLoaderClient.h: 39 (WebLoaderClient): 40 41 didFirstLayoutForFrame, didFirstVisuallyNonEmptyLayoutForFrame, 42 and didNewFirstVisuallyNonEmptyLayout are now implemented with 43 didLayout under the hood. So if those old callbacks have been 44 defined, be sure to add the appropriate layout milestones here for 45 backwards-compatibility. 46 * UIProcess/WebPageProxy.cpp: 47 (WebKit::WebPageProxy::initializeLoaderClient): 48 49 New API. 50 (WebKit::WebPageProxy::listenForLayoutMilestones): 51 (WebKit): 52 (WebKit::WebPageProxy::didLayout): 53 * UIProcess/WebPageProxy.h: 54 (WebPageProxy): 55 * UIProcess/WebPageProxy.messages.in: 56 57 New API. And remove the now-unnecessary 58 WKBundlePageSetPaintedObjectsCounterThreshold. 59 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: 60 (WKBundlePageListenForLayoutMilestones): 61 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 62 * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: 63 64 New API. 65 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: 66 (WebKit::InjectedBundlePageLoaderClient::didNewFirstVisuallyNonEmptyLayout): 67 (WebKit): 68 (WebKit::InjectedBundlePageLoaderClient::didLayout): 69 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: 70 (InjectedBundlePageLoaderClient): 71 72 Remove dispatchDidFirstLayout, 73 dispatchDidFirstVisuallyNonEmptyLayout, and 74 dispatchDidNewFirstVisuallyNonEmptyLayout. They are now replaced 75 by dispatchDidLayout(LayoutMilestoneOptions) 76 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 77 (WebKit::WebFrameLoaderClient::dispatchDidLayout): 78 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 79 (WebFrameLoaderClient): 80 81 didFirstLayoutForFrame, didFirstVisuallyNonEmptyLayoutForFrame, 82 and didNewFirstVisuallyNonEmptyLayout are now implemented with 83 didLayout under the hood. So if those old callbacks have been 84 defined, be sure to add the appropriate layout milestones here for 85 backwards-compatibility. 86 * WebProcess/WebPage/WebPage.cpp: 87 (WebKit::WebPage::initializeInjectedBundleLoaderClient): 88 (WebKit): 89 90 Call into WebCore to set the layout milestones. 91 (WebKit::WebPage::listenForLayoutMilestones): 92 * WebProcess/WebPage/WebPage.h: 93 (WebPage): 94 * WebProcess/WebPage/WebPage.messages.in: 95 96 Account for the new member of PageLoadClient. 97 * WebProcess/qt/QtBuiltinBundlePage.cpp: 98 (WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage): 99 1 100 2012-09-25 Carlos Garcia Campos <cgarcia@igalia.com> 2 101 -
trunk/Source/WebKit2/Shared/API/c/WKPageLoadTypes.h
r95901 r129545 49 49 typedef uint32_t WKSameDocumentNavigationType; 50 50 51 enum { 52 kWKDidFirstLayout = 1 << 0, 53 kWKDidFirstVisuallyNonEmptyLayout = 1 << 1, 54 kWKDidHitRelevantRepaintedObjectsAreaThreshold = 1 << 2 55 }; 56 typedef uint32_t WKLayoutMilestones; 57 51 58 #ifdef __cplusplus 52 59 } -
trunk/Source/WebKit2/Shared/API/c/WKSharedAPICast.h
r125700 r129545 48 48 #include <WebCore/FrameLoaderTypes.h> 49 49 #include <WebCore/IntRect.h> 50 #include <WebCore/LayoutMilestones.h> 50 51 #include <wtf/TypeTraits.h> 51 52 … … 749 750 } 750 751 752 inline WKLayoutMilestones toWKLayoutMilestones(WebCore::LayoutMilestones milestones) 753 { 754 unsigned wkMilestones = 0; 755 756 if (milestones & WebCore::DidFirstLayout) 757 wkMilestones |= kWKDidFirstLayout; 758 if (milestones & WebCore::DidFirstVisuallyNonEmptyLayout) 759 wkMilestones |= kWKDidFirstVisuallyNonEmptyLayout; 760 if (milestones & WebCore::DidHitRelevantRepaintedObjectsAreaThreshold) 761 wkMilestones |= kWKDidHitRelevantRepaintedObjectsAreaThreshold; 762 763 return wkMilestones; 764 } 765 766 inline WebCore::LayoutMilestones toLayoutMilestones(WKLayoutMilestones wkMilestones) 767 { 768 WebCore::LayoutMilestones milestones = 0; 769 770 if (wkMilestones & kWKDidFirstLayout) 771 milestones |= WebCore::DidFirstLayout; 772 if (wkMilestones & kWKDidFirstVisuallyNonEmptyLayout) 773 milestones |= WebCore::DidFirstVisuallyNonEmptyLayout; 774 if (wkMilestones & kWKDidHitRelevantRepaintedObjectsAreaThreshold) 775 milestones |= WebCore::DidHitRelevantRepaintedObjectsAreaThreshold; 776 777 return milestones; 778 } 779 751 780 inline ImageOptions toImageOptions(WKImageOptions wkImageOptions) 752 781 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r129096 r129545 331 331 } 332 332 333 void WKPageListenForLayoutMilestones(WKPageRef pageRef, WKLayoutMilestones milestones) 334 { 335 toImpl(pageRef)->listenForLayoutMilestones(toLayoutMilestones(milestones)); 336 } 337 333 338 bool WKPageHasHorizontalScrollbar(WKPageRef pageRef) 334 339 { -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.h
r128553 r129545 76 76 typedef void (*WKPageDidReceiveIntentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent, WKTypeRef userData, const void *clientInfo); 77 77 typedef void (*WKPageRegisterIntentServiceForFrameCallback)(WKPageRef page, WKFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef userData, const void *clientInfo); 78 typedef void (*WKPageDidLayoutCallback)(WKPageRef page, WKLayoutMilestones milestones, WKTypeRef userData, const void *clientInfo); 78 79 79 80 // Deprecated … … 116 117 WKPageDidDetectXSSForFrameCallback didDetectXSSForFrame; 117 118 118 // FIXME: didFirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged. 119 // FIXME: didNewFirstVisuallyNonEmptyLayout should be removed. We should consider removing didFirstVisuallyNonEmptyLayoutForFrame 120 // as well. Their functionality is replaced by didLayout. 119 121 WKPageDidNewFirstVisuallyNonEmptyLayoutCallback didNewFirstVisuallyNonEmptyLayout; 120 122 … … 127 129 WKPageDidReceiveIntentForFrameCallback didReceiveIntentForFrame; 128 130 WKPageRegisterIntentServiceForFrameCallback registerIntentServiceForFrame; 131 132 WKPageDidLayoutCallback didLayout; 129 133 }; 130 134 typedef struct WKPageLoaderClient WKPageLoaderClient; … … 426 430 WK_EXPORT WKSize WKPageFixedLayoutSize(WKPageRef page); 427 431 432 WK_EXPORT void WKPageListenForLayoutMilestones(WKPageRef page, WKLayoutMilestones milestones); 433 428 434 WK_EXPORT bool WKPageHasHorizontalScrollbar(WKPageRef page); 429 435 WK_EXPORT bool WKPageHasVerticalScrollbar(WKPageRef page); -
trunk/Source/WebKit2/UIProcess/WebLoaderClient.cpp
r123374 r129545 137 137 } 138 138 139 void WebLoaderClient::didLayout(WebPageProxy* page, LayoutMilestones milestones, APIObject* userData) 140 { 141 if (!m_client.didLayout) 142 return; 143 144 m_client.didLayout(toAPI(page), toWKLayoutMilestones(milestones), toAPI(userData), m_client.clientInfo); 145 } 146 139 147 void WebLoaderClient::didRemoveFrameFromHierarchy(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData) 140 148 { -
trunk/Source/WebKit2/UIProcess/WebLoaderClient.h
r123374 r129545 30 30 #include "SameDocumentNavigationType.h" 31 31 #include "WKPage.h" 32 #include <WebCore/LayoutMilestones.h> 32 33 #include <wtf/Forward.h> 33 34 #include <wtf/RefPtr.h> … … 81 82 #endif 82 83 83 // FIXME: did FirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged.84 // The only reason for both to exist is to experiment with different heuristics for the time being.84 // FIXME: didNewFirstVisuallyNonEmptyLayout should be removed. We should consider removing didFirstVisuallyNonEmptyLayoutForFrame 85 // as well. They are both being replaced by didLayout. 85 86 void didNewFirstVisuallyNonEmptyLayout(WebPageProxy*, APIObject*); 87 void didLayout(WebPageProxy*, WebCore::LayoutMilestones, APIObject*); 86 88 87 89 bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy*, WebFrameProxy*, WebProtectionSpace*); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r129493 r129545 285 285 return; 286 286 287 // It would be nice to get rid of this code and transition all clients to using didLayout instead of 288 // didFirstLayoutInFrame and didFirstVisuallyNonEmptyLayoutInFrame. In the meantime, this is required 289 // for backwards compatibility. 290 WebCore::LayoutMilestones milestones = 0; 291 if (loadClient->didFirstLayoutForFrame) 292 milestones |= WebCore::DidFirstLayout; 293 if (loadClient->didFirstVisuallyNonEmptyLayoutForFrame) 294 milestones |= WebCore::DidFirstVisuallyNonEmptyLayout; 295 if (loadClient->didNewFirstVisuallyNonEmptyLayout) 296 milestones |= WebCore::DidHitRelevantRepaintedObjectsAreaThreshold; 297 298 if (milestones) 299 m_process->send(Messages::WebPage::ListenForLayoutMilestones(milestones), m_pageID); 300 287 301 m_process->send(Messages::WebPage::SetWillGoToBackForwardItemCallbackEnabled(loadClient->version > 0), m_pageID); 288 302 } … … 1513 1527 } 1514 1528 1529 void WebPageProxy::listenForLayoutMilestones(WebCore::LayoutMilestones milestones) 1530 { 1531 if (!isValid()) 1532 return; 1533 1534 m_process->send(Messages::WebPage::ListenForLayoutMilestones(milestones), m_pageID); 1535 } 1536 1515 1537 void WebPageProxy::setSuppressScrollbarAnimations(bool suppressAnimations) 1516 1538 { … … 2163 2185 2164 2186 m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get()); 2187 } 2188 2189 void WebPageProxy::didLayout(uint32_t layoutMilestones, CoreIPC::ArgumentDecoder* arguments) 2190 { 2191 RefPtr<APIObject> userData; 2192 WebContextUserMessageDecoder messageDecoder(userData, m_process.get()); 2193 if (!arguments->decode(messageDecoder)) 2194 return; 2195 2196 m_loaderClient.didLayout(this, static_cast<LayoutMilestones>(layoutMilestones), userData.get()); 2165 2197 } 2166 2198 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r128907 r129545 485 485 const WebCore::IntSize& fixedLayoutSize() const { return m_fixedLayoutSize; }; 486 486 487 void listenForLayoutMilestones(WebCore::LayoutMilestones); 488 487 489 bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; } 488 490 bool hasVerticalScrollbar() const { return m_mainFrameHasVerticalScrollbar; } … … 766 768 void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*); 767 769 void didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder*); 770 void didLayout(uint32_t layoutMilestones, CoreIPC::ArgumentDecoder*); 768 771 void didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder*); 769 772 void didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r128907 r129545 128 128 DidFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) 129 129 DidNewFirstVisuallyNonEmptyLayout(WebKit::InjectedBundleUserMessageEncoder userData) 130 DidLayout(uint32_t type, WebKit::InjectedBundleUserMessageEncoder userData) 130 131 DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, WTF::String url, WebKit::InjectedBundleUserMessageEncoder userData) 131 132 DidRemoveFrameFromHierarchy(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
r129493 r129545 322 322 } 323 323 324 void WKBundlePageListenForLayoutMilestones(WKBundlePageRef pageRef, WKLayoutMilestones milestones) 325 { 326 toImpl(pageRef)->listenForLayoutMilestones(toLayoutMilestones(milestones)); 327 } 328 324 329 void WKBundlePageDeliverIntentToFrame(WKBundlePageRef pageRef, WKBundleFrameRef frameRef, WKBundleIntentRef intentRef) 325 330 { … … 371 376 } 372 377 373 void WKBundlePageSetPaintedObjectsCounterThreshold(WKBundlePageRef page, uint64_t threshold)374 {375 toImpl(page)->setPaintedObjectsCounterThreshold(threshold);376 }377 378 378 void WKBundlePageSetTracksRepaints(WKBundlePageRef pageRef, bool trackRepaints) 379 379 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r128623 r129545 112 112 typedef void (*WKBundlePageDidReceiveIntentForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRequestRef intentRequest, WKTypeRef* userData, const void* clientInfo); 113 113 typedef void (*WKBundlePageRegisterIntentServiceForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKIntentServiceInfoRef serviceInfo, WKTypeRef* userData, const void* clientInfo); 114 typedef void (*WKBundlePageDidLayoutCallback)(WKBundlePageRef page, WKLayoutMilestones milestones, WKTypeRef* userData, const void *clientInfo); 114 115 115 116 struct WKBundlePageLoaderClient { … … 154 155 WKBundlePageDidReceiveIntentForFrameCallback didReceiveIntentForFrame; 155 156 WKBundlePageRegisterIntentServiceForFrameCallback registerIntentServiceForFrame; 157 WKBundlePageDidLayoutCallback didLayout; 156 158 }; 157 159 typedef struct WKBundlePageLoaderClient WKBundlePageLoaderClient; … … 420 422 WK_EXPORT double WKBundlePageGetBackingScaleFactor(WKBundlePageRef page); 421 423 424 WK_EXPORT void WKBundlePageListenForLayoutMilestones(WKBundlePageRef page, WKLayoutMilestones milestones); 425 422 426 WK_EXPORT void WKBundlePageDeliverIntentToFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleIntentRef intent); 423 427 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
r129479 r129545 59 59 WK_EXPORT WKRenderLayerRef WKBundlePageCopyRenderLayerTree(WKBundlePageRef page); 60 60 61 // FIXME: This is temporary. Ultimately WebKit should choose the threshold itself.62 WK_EXPORT void WKBundlePageSetPaintedObjectsCounterThreshold(WKBundlePageRef page, uint64_t threshold);63 64 61 WK_EXPORT void WKBundlePageSetTracksRepaints(WKBundlePageRef page, bool trackRepaints); 65 62 WK_EXPORT bool WKBundlePageIsTrackingRepaints(WKBundlePageRef page); -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
r128129 r129545 255 255 m_client.didNewFirstVisuallyNonEmptyLayout(toAPI(page), &userDataToPass, m_client.clientInfo); 256 256 userData = adoptRef(toImpl(userDataToPass)); 257 } 257 } 258 259 void InjectedBundlePageLoaderClient::didLayout(WebPage* page, LayoutMilestones milestones, RefPtr<APIObject>& userData) 260 { 261 if (!m_client.didLayout) 262 return; 263 264 WKTypeRef userDataToPass = 0; 265 m_client.didLayout(toAPI(page), toWKLayoutMilestones(milestones), &userDataToPass, m_client.clientInfo); 266 userData = adoptRef(toImpl(userDataToPass)); 267 } 258 268 259 269 void InjectedBundlePageLoaderClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, DOMWrapperWorld* world) -
trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
r128129 r129545 31 31 #include "WKBundlePage.h" 32 32 #include <JavaScriptCore/JSBase.h> 33 #include <WebCore/LayoutMilestones.h> 33 34 #include <wtf/Forward.h> 34 35 … … 83 84 void didLayoutForFrame(WebPage*, WebFrame*); 84 85 void didNewFirstVisuallyNonEmptyLayout(WebPage*, WTF::RefPtr<APIObject>& userData); 86 void didLayout(WebPage*, WebCore::LayoutMilestones, RefPtr<APIObject>& userData); 85 87 86 88 void didClearWindowObjectForFrame(WebPage*, WebFrame*, WebCore::DOMWrapperWorld*); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r129096 r129545 545 545 } 546 546 547 void WebFrameLoaderClient::dispatchDidFirstLayout() 548 { 549 WebPage* webPage = m_frame->page(); 550 if (!webPage) 551 return; 552 553 RefPtr<APIObject> userData; 554 555 // Notify the bundle client. 556 webPage->injectedBundleLoaderClient().didFirstLayoutForFrame(webPage, m_frame, userData); 557 558 // Notify the UIProcess. 559 webPage->send(Messages::WebPageProxy::DidFirstLayoutForFrame(m_frame->frameID(), InjectedBundleUserMessageEncoder(userData.get()))); 560 561 if (m_frame == m_frame->page()->mainWebFrame() && !webPage->corePage()->settings()->suppressesIncrementalRendering()) 562 webPage->drawingArea()->setLayerTreeStateIsFrozen(false); 563 547 void WebFrameLoaderClient::dispatchDidLayout(LayoutMilestones milestones) 548 { 549 WebPage* webPage = m_frame->page(); 550 if (!webPage) 551 return; 552 553 RefPtr<APIObject> userData; 554 555 webPage->injectedBundleLoaderClient().didLayout(webPage, milestones, userData); 556 webPage->send(Messages::WebPageProxy::DidLayout(milestones, InjectedBundleUserMessageEncoder(userData.get()))); 557 558 if (milestones & DidFirstLayout) { 559 // FIXME: We should consider removing the old didFirstLayout API since this is doing double duty with the 560 // new didLayout API. 561 webPage->injectedBundleLoaderClient().didFirstLayoutForFrame(webPage, m_frame, userData); 562 webPage->send(Messages::WebPageProxy::DidFirstLayoutForFrame(m_frame->frameID(), InjectedBundleUserMessageEncoder(userData.get()))); 563 564 if (m_frame == m_frame->page()->mainWebFrame()) { 565 if (!webPage->corePage()->settings()->suppressesIncrementalRendering()) 566 webPage->drawingArea()->setLayerTreeStateIsFrozen(false); 567 } 568 564 569 #if USE(TILED_BACKING_STORE) 565 // Make sure viewport properties are dispatched on the main frame by the time the first layout happens.566 ASSERT(!webPage->useFixedLayout() || m_frame != m_frame->page()->mainWebFrame() || m_frame->coreFrame()->document()->didDispatchViewportPropertiesChanged());570 // Make sure viewport properties are dispatched on the main frame by the time the first layout happens. 571 ASSERT(!webPage->useFixedLayout() || m_frame != m_frame->page()->mainWebFrame() || m_frame->coreFrame()->document()->didDispatchViewportPropertiesChanged()); 567 572 #endif 568 } 569 570 void WebFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout() 571 { 572 WebPage* webPage = m_frame->page(); 573 if (!webPage) 574 return; 575 576 RefPtr<APIObject> userData; 577 578 // Notify the bundle client. 579 webPage->injectedBundleLoaderClient().didFirstVisuallyNonEmptyLayoutForFrame(webPage, m_frame, userData); 580 581 // Notify the UIProcess. 582 webPage->send(Messages::WebPageProxy::DidFirstVisuallyNonEmptyLayoutForFrame(m_frame->frameID(), InjectedBundleUserMessageEncoder(userData.get()))); 583 } 584 585 void WebFrameLoaderClient::dispatchDidNewFirstVisuallyNonEmptyLayout() 586 { 587 WebPage* webPage = m_frame->page(); 588 if (!webPage) 589 return; 590 591 RefPtr<APIObject> userData; 592 593 // Notify the bundle client. 594 webPage->injectedBundleLoaderClient().didNewFirstVisuallyNonEmptyLayout(webPage, userData); 595 596 // Notify the UIProcess. 597 webPage->send(Messages::WebPageProxy::DidNewFirstVisuallyNonEmptyLayout(InjectedBundleUserMessageEncoder(userData.get()))); 573 } 574 575 if (milestones & DidFirstVisuallyNonEmptyLayout) { 576 // FIXME: We should consider removing the old didFirstVisuallyNonEmptyLayoutForFrame API since this is doing 577 // double duty with the new didLayout API. 578 webPage->injectedBundleLoaderClient().didFirstVisuallyNonEmptyLayoutForFrame(webPage, m_frame, userData); 579 webPage->send(Messages::WebPageProxy::DidFirstVisuallyNonEmptyLayoutForFrame(m_frame->frameID(), InjectedBundleUserMessageEncoder(userData.get()))); 580 } 581 582 if (milestones & DidHitRelevantRepaintedObjectsAreaThreshold) { 583 // FIXME: This can go away when we remove didNewFirstVisuallyNonEmptyLayout. 584 webPage->injectedBundleLoaderClient().didNewFirstVisuallyNonEmptyLayout(webPage, userData); 585 webPage->send(Messages::WebPageProxy::DidNewFirstVisuallyNonEmptyLayout(InjectedBundleUserMessageEncoder(userData.get()))); 586 } 598 587 } 599 588 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r128129 r129545 98 98 virtual void dispatchDidFinishLoad() OVERRIDE; 99 99 100 virtual void dispatchDidFirstLayout() OVERRIDE; 101 virtual void dispatchDidFirstVisuallyNonEmptyLayout() OVERRIDE; 102 virtual void dispatchDidNewFirstVisuallyNonEmptyLayout() OVERRIDE; 100 virtual void dispatchDidLayout(WebCore::LayoutMilestones) OVERRIDE; 103 101 virtual void dispatchDidLayout() OVERRIDE; 104 102 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r129514 r129545 397 397 void WebPage::initializeInjectedBundleLoaderClient(WKBundlePageLoaderClient* client) 398 398 { 399 // It would be nice to get rid of this code and transition all clients to using didLayout instead of 400 // didFirstLayoutInFrame and didFirstVisuallyNonEmptyLayoutInFrame. In the meantime, this is required 401 // for backwards compatibility. 402 LayoutMilestones milestones = 0; 403 if (client) { 404 if (client->didFirstLayoutForFrame) 405 milestones |= WebCore::DidFirstLayout; 406 if (client->didFirstVisuallyNonEmptyLayoutForFrame) 407 milestones |= WebCore::DidFirstVisuallyNonEmptyLayout; 408 if (client->didNewFirstVisuallyNonEmptyLayout) 409 milestones |= WebCore::DidHitRelevantRepaintedObjectsAreaThreshold; 410 } 411 412 if (milestones) 413 listenForLayoutMilestones(milestones); 414 399 415 m_loaderClient.initialize(client); 400 416 } … … 561 577 } 562 578 563 void WebPage::setPaintedObjectsCounterThreshold(uint64_t threshold)564 {565 if (!m_page)566 return;567 m_page->setRelevantRepaintedObjectsCounterThreshold(threshold);568 }569 570 579 void WebPage::setTracksRepaints(bool trackRepaints) 571 580 { … … 1122 1131 if (view->didFirstLayout()) 1123 1132 view->forceLayout(); 1133 } 1134 1135 void WebPage::listenForLayoutMilestones(uint32_t milestones) 1136 { 1137 if (!m_page) 1138 return; 1139 m_page->addLayoutMilestones(static_cast<LayoutMilestones>(milestones)); 1124 1140 } 1125 1141 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r128907 r129545 284 284 String renderTreeExternalRepresentation() const; 285 285 uint64_t renderTreeSize() const; 286 void setPaintedObjectsCounterThreshold(uint64_t);287 286 288 287 void setTracksRepaints(bool); … … 309 308 bool useFixedLayout() const { return m_useFixedLayout; } 310 309 void setFixedLayoutSize(const WebCore::IntSize&); 310 311 void listenForLayoutMilestones(uint32_t /* LayoutMilestones */); 311 312 312 313 void setSuppressScrollbarAnimations(bool); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r128907 r129545 140 140 SetUseFixedLayout(bool fixed) 141 141 SetFixedLayoutSize(WebCore::IntSize size) 142 142 ListenForLayoutMilestones(uint32_t milestones) 143 143 SetSuppressScrollbarAnimations(bool suppressAnimations) 144 144 -
trunk/Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.cpp
r128129 r129545 79 79 0, // didReceiveIntentForFrame 80 80 0, // registerIntentServiceForFrame 81 0, // didLayout 81 82 }; 82 83 WKBundlePageSetPageLoaderClient(m_page, &loaderClient); -
trunk/Tools/ChangeLog
r129536 r129545 1 2012-09-25 Beth Dakin <bdakin@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=95397 4 Need to merge didFirstVisuallyNonEmptyLayout and 5 didNewFirstVisuallyNonEmptyLayout 6 -and corresponding- 7 <rdar://problem/10791680> 8 9 Reviewed by Sam Weinig. 10 11 Account for the new member of the PageLoadClient. 12 * MiniBrowser/mac/BrowserWindowController.m: 13 (-[BrowserWindowController awakeFromNib]): 14 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 15 (WTR::InjectedBundlePage::InjectedBundlePage): 16 * WebKitTestRunner/TestController.cpp: 17 (WTR::TestController::initialize): 18 19 The NewFirstVisuallyNonEmptyLayoutForImages has existed for a while, 20 but it did not have the right target membership. 21 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 22 23 Use new didLayout API instead of old 24 didNewFirstVisuallyNonEmptyLayout API. 25 * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp: 26 (TestWebKitAPI): 27 (TestWebKitAPI::didLayout): 28 (TestWebKitAPI::setPageLoaderClient): 29 (TestWebKitAPI::TEST): 30 * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp: 31 (TestWebKitAPI): 32 (TestWebKitAPI::didLayout): 33 (TestWebKitAPI::setPageLoaderClient): 34 (TestWebKitAPI::TEST): 35 * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp: 36 (TestWebKitAPI): 37 (TestWebKitAPI::didLayout): 38 (TestWebKitAPI::setPageLoaderClient): 39 (TestWebKitAPI::TEST): 40 * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp: 41 (TestWebKitAPI): 42 (TestWebKitAPI::didLayout): 43 (TestWebKitAPI::setPageLoaderClient): 44 (TestWebKitAPI::TEST): 45 1 46 2012-09-25 Benjamin Poulain <bpoulain@apple.com> 2 47 -
trunk/Tools/MiniBrowser/mac/BrowserWindowController.m
r128553 r129545 636 636 0, // didReceiveIntentForFrame 637 637 0, // registerIntentServiceForFrame 638 0, // didLayout 638 639 }; 639 640 WKPageSetPageLoaderClient(_webView.pageRef, &loadClient); -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r127001 r129545 73 73 81B50193140F232300D9EB58 /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 81B50192140F232300D9EB58 /* StringBuilder.cpp */; }; 74 74 930AD402150698D00067970F /* lots-of-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 930AD401150698B30067970F /* lots-of-text.html */; }; 75 9318778915EEC57700A9CCE3 /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4ECA1506F035007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages.cpp */; }; 75 76 9361002914DC95A70061379D /* lots-of-iframes.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9361002814DC957B0061379D /* lots-of-iframes.html */; }; 76 77 939BA91714103412001A01BD /* DeviceScaleFactorOnBack.mm in Sources */ = {isa = PBXBuildFile; fileRef = 939BA91614103412001A01BD /* DeviceScaleFactorOnBack.mm */; }; … … 986 987 BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */, 987 988 265AF55015D1E48A00B0CB4A /* WTFString.cpp in Sources */, 989 9318778915EEC57700A9CCE3 /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */, 988 990 ); 989 991 runOnlyForDeploymentPostprocessing = 0; -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp
r116180 r129545 31 31 namespace TestWebKitAPI { 32 32 33 static bool didNewFirstVisuallyNonEmptyLayoutSucceed; 33 static bool didFirstLayoutAchieved; 34 static bool didFirstVisuallyNonEmptyLayoutAchieved; 35 static bool didHitRelevantRepaintedObjectsAreaThresholdAchieved; 36 static bool didUnlockAllLayoutMilestones; 34 37 35 static void did NewFirstVisuallyNonEmptyLayout(WKPageRef, WKTypeRef, const void *)38 static void didLayout(WKPageRef, WKLayoutMilestones type, WKTypeRef, const void *) 36 39 { 37 didNewFirstVisuallyNonEmptyLayoutSucceed = true; 40 switch (type) { 41 case kWKDidFirstLayout: 42 didFirstLayoutAchieved = true; 43 break; 44 case kWKDidFirstVisuallyNonEmptyLayout: 45 didFirstVisuallyNonEmptyLayoutAchieved = true; 46 break; 47 case kWKDidHitRelevantRepaintedObjectsAreaThreshold: 48 didHitRelevantRepaintedObjectsAreaThresholdAchieved = true; 49 break; 50 default: 51 break; 52 } 53 54 if (didFirstLayoutAchieved && didFirstVisuallyNonEmptyLayoutAchieved && didHitRelevantRepaintedObjectsAreaThresholdAchieved) 55 didUnlockAllLayoutMilestones = true; 38 56 } 39 57 … … 43 61 memset(&loaderClient, 0, sizeof(loaderClient)); 44 62 loaderClient.version = kWKPageLoaderClientCurrentVersion; 45 loaderClient.did NewFirstVisuallyNonEmptyLayout = didNewFirstVisuallyNonEmptyLayout;63 loaderClient.didLayout = didLayout; 46 64 47 65 WKPageSetPageLoaderClient(page, &loaderClient); 48 66 } 49 67 68 // FIXME: This test has been broken since http://trac.webkit.org/changeset/115752 It's failing because 69 // the frame load is completing before didLayout() manages to unlock the 70 // kWKDidHitRelevantRepaintedObjectsAreaThreshold achievement. We probably need to fix this by making 71 // this test have a long-running resource. 50 72 TEST(WebKit2, DISABLED_NewFirstVisuallyNonEmptyLayout) 51 73 { … … 59 81 WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("lots-of-text", "html")).get()); 60 82 61 Util::run(&did NewFirstVisuallyNonEmptyLayoutSucceed);62 EXPECT_TRUE(did NewFirstVisuallyNonEmptyLayoutSucceed);83 Util::run(&didUnlockAllLayoutMilestones); 84 EXPECT_TRUE(didUnlockAllLayoutMilestones); 63 85 } 64 86 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp
r109944 r129545 33 33 namespace TestWebKitAPI { 34 34 35 static bool did NewFirstVisuallyNonEmptyLayoutSucceed;35 static bool didHitRelevantRepaintedObjectsAreaThresholdAchieved; 36 36 static bool test1Done; 37 37 static bool test2Done; … … 49 49 } 50 50 51 static void did NewFirstVisuallyNonEmptyLayout(WKPageRef, WKTypeRef, const void *)51 static void didLayout(WKPageRef, WKLayoutMilestones type, WKTypeRef, const void *) 52 52 { 53 didNewFirstVisuallyNonEmptyLayoutSucceed = true; 53 if (type == kWKDidHitRelevantRepaintedObjectsAreaThreshold) 54 didHitRelevantRepaintedObjectsAreaThresholdAchieved = true; 54 55 } 55 56 … … 60 61 loaderClient.version = kWKPageLoaderClientCurrentVersion; 61 62 loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; 62 loaderClient.did NewFirstVisuallyNonEmptyLayout = didNewFirstVisuallyNonEmptyLayout;63 loaderClient.didLayout = didLayout; 63 64 64 65 WKPageSetPageLoaderClient(page, &loaderClient); … … 81 82 // By the time the forced repaint has finished, the counter would have been hit 82 83 // if it was sized reasonably for the page. 83 EXPECT_FALSE(did NewFirstVisuallyNonEmptyLayoutSucceed);84 EXPECT_FALSE(didHitRelevantRepaintedObjectsAreaThresholdAchieved); 84 85 } 85 86 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
r109944 r129545 42 42 virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page) 43 43 { 44 // Setting the painted objects counter is necessary at this time to opt into 45 // the didNewFirstVisuallyNonEmptyLayout heuristic. 46 WKBundlePageSetPaintedObjectsCounterThreshold(page, 1); 44 WKBundlePageListenForLayoutMilestones(page, kWKDidFirstLayout | kWKDidFirstVisuallyNonEmptyLayout | kWKDidHitRelevantRepaintedObjectsAreaThreshold); 47 45 } 48 46 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp
r110218 r129545 31 31 namespace TestWebKitAPI { 32 32 33 static bool didNewFirstVisuallyNonEmptyLayoutSucceed; 33 static bool didFirstLayoutAchieved; 34 static bool didFirstVisuallyNonEmptyLayoutAchieved; 35 static bool didHitRelevantRepaintedObjectsAreaThresholdAchieved; 36 static bool didUnlockAllLayoutMilestones; 34 37 35 static void did NewFirstVisuallyNonEmptyLayout(WKPageRef, WKTypeRef, const void *)38 static void didLayout(WKPageRef, WKLayoutMilestones type, WKTypeRef, const void *) 36 39 { 37 didNewFirstVisuallyNonEmptyLayoutSucceed = true; 40 switch (type) { 41 case kWKDidFirstLayout: 42 didFirstLayoutAchieved = true; 43 break; 44 case kWKDidFirstVisuallyNonEmptyLayout: 45 didFirstVisuallyNonEmptyLayoutAchieved = true; 46 break; 47 case kWKDidHitRelevantRepaintedObjectsAreaThreshold: 48 didHitRelevantRepaintedObjectsAreaThresholdAchieved = true; 49 break; 50 default: 51 break; 52 } 53 54 if (didFirstLayoutAchieved && didFirstVisuallyNonEmptyLayoutAchieved && didHitRelevantRepaintedObjectsAreaThresholdAchieved) 55 didUnlockAllLayoutMilestones = true; 38 56 } 39 57 … … 43 61 memset(&loaderClient, 0, sizeof(loaderClient)); 44 62 loaderClient.version = kWKPageLoaderClientCurrentVersion; 45 loaderClient.did NewFirstVisuallyNonEmptyLayout = didNewFirstVisuallyNonEmptyLayout;63 loaderClient.didLayout = didLayout; 46 64 47 65 WKPageSetPageLoaderClient(page, &loaderClient); 48 66 } 49 67 50 TEST(WebKit2, NewFirstVisuallyNonEmptyLayoutForImages) 68 // FIXME: This test has been broken since http://trac.webkit.org/changeset/115752 It's failing because 69 // the frame load is completing before didLayout() manages to unlock the 70 // kWKDidHitRelevantRepaintedObjectsAreaThreshold achievement. We probably need to fix this by making 71 // this test have a long-running resource. 72 TEST(WebKit2, DISABLED_NewFirstVisuallyNonEmptyLayoutForImages) 51 73 { 52 74 WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutForImagesTest")); … … 59 81 WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("lots-of-images", "html")).get()); 60 82 61 Util::run(&did NewFirstVisuallyNonEmptyLayoutSucceed);62 EXPECT_TRUE(did NewFirstVisuallyNonEmptyLayoutSucceed);83 Util::run(&didUnlockAllLayoutMilestones); 84 EXPECT_TRUE(didUnlockAllLayoutMilestones); 63 85 } 64 86 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
r110218 r129545 42 42 virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page) 43 43 { 44 // Setting the painted objects counter is necessary at this time to opt into 45 // the didNewFirstVisuallyNonEmptyLayout heuristic. 46 WKBundlePageSetPaintedObjectsCounterThreshold(page, 1); 44 WKBundlePageListenForLayoutMilestones(page, kWKDidFirstLayout | kWKDidFirstVisuallyNonEmptyLayout | kWKDidHitRelevantRepaintedObjectsAreaThreshold); 47 45 } 48 46 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp
r106725 r129545 33 33 namespace TestWebKitAPI { 34 34 35 static bool did NewFirstVisuallyNonEmptyLayoutFireMoreThanOnce;36 static unsigned newVisuallyNonEmptyLayoutCounter;35 static bool didHitRelevantRepaintedObjectsAreaThresholdMoreThanOnce; 36 static unsigned didHitRelevantRepaintedObjectsAreaThresholdCounter; 37 37 static bool test1Done; 38 38 static bool test2Done; … … 50 50 } 51 51 52 static void did NewFirstVisuallyNonEmptyLayout(WKPageRef, WKTypeRef, const void *)52 static void didLayout(WKPageRef, WKLayoutMilestones type, WKTypeRef, const void *) 53 53 { 54 ++newVisuallyNonEmptyLayoutCounter; 55 if (newVisuallyNonEmptyLayoutCounter > 1) 56 didNewFirstVisuallyNonEmptyLayoutFireMoreThanOnce = true; 54 if (type != kWKDidHitRelevantRepaintedObjectsAreaThreshold) 55 return; 56 57 ++didHitRelevantRepaintedObjectsAreaThresholdCounter; 58 if (didHitRelevantRepaintedObjectsAreaThresholdCounter > 1) 59 didHitRelevantRepaintedObjectsAreaThresholdMoreThanOnce = true; 57 60 } 58 61 … … 63 66 loaderClient.version = kWKPageLoaderClientCurrentVersion; 64 67 loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; 65 loaderClient.did NewFirstVisuallyNonEmptyLayout = didNewFirstVisuallyNonEmptyLayout;68 loaderClient.didLayout = didLayout; 66 69 67 70 WKPageSetPageLoaderClient(page, &loaderClient); … … 70 73 TEST(WebKit2, NewFirstVisuallyNonEmptyLayoutFrames) 71 74 { 72 newVisuallyNonEmptyLayoutCounter = 0;75 didHitRelevantRepaintedObjectsAreaThresholdCounter = 0; 73 76 WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("NewFirstVisuallyNonEmptyLayoutFramesTest")); 74 77 … … 83 86 // By the time the forced repaint has finished, the counter would have been hit 84 87 // if it was sized reasonably for the page. 85 EXPECT_FALSE(did NewFirstVisuallyNonEmptyLayoutFireMoreThanOnce);88 EXPECT_FALSE(didHitRelevantRepaintedObjectsAreaThresholdMoreThanOnce); 86 89 } 87 90 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
r109944 r129545 42 42 virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page) 43 43 { 44 // Setting the painted objects counter is necessary at this time to opt into 45 // the didNewFirstVisuallyNonEmptyLayout heuristic. 46 WKBundlePageSetPaintedObjectsCounterThreshold(page, 1); 44 WKBundlePageListenForLayoutMilestones(page, kWKDidFirstLayout | kWKDidFirstVisuallyNonEmptyLayout | kWKDidHitRelevantRepaintedObjectsAreaThreshold); 47 45 } 48 46 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
r109944 r129545 42 42 virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page) 43 43 { 44 // Setting the painted objects counter is necessary at this time to opt into 45 // the didNewFirstVisuallyNonEmptyLayout heuristic. 46 WKBundlePageSetPaintedObjectsCounterThreshold(page, 1); 44 WKBundlePageListenForLayoutMilestones(page, kWKDidFirstLayout | kWKDidFirstVisuallyNonEmptyLayout | kWKDidHitRelevantRepaintedObjectsAreaThreshold); 47 45 } 48 46 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r129487 r129545 329 329 0, // shouldForceUniversalAccessFromLocalURL 330 330 didReceiveIntentForFrame, // didReceiveIntentForFrame 331 registerIntentServiceForFrame // registerIntentServiceForFrame 331 registerIntentServiceForFrame, // registerIntentServiceForFrame 332 0, // didLayout 332 333 }; 333 334 WKBundlePageSetPageLoaderClient(m_page, &loaderClient); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r129536 r129545 443 443 0, // didReceiveIntentForFrame 444 444 0, // registerIntentServiceForFrame 445 0, // didLayout 445 446 }; 446 447 WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
Note:
See TracChangeset
for help on using the changeset viewer.