https://bugs.webkit.org/show_bug.cgi?id=95397
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 20:01:33 +0000 (20:01 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Sep 2012 20:01:33 +0000 (20:01 +0000)
commitc402992e68ba753389c68e9c72d524f2f3fb700a
tree51761b8a0443739dcffff0948a89e5e866937379
parentb8ff1ed7a49e05a39a108532c59045fcd5894720
https://bugs.webkit.org/show_bug.cgi?id=95397
Need to merge didFirstVisuallyNonEmptyLayout and
didNewFirstVisuallyNonEmptyLayout
-and corresponding-
<rdar://problem/10791680>

Reviewed by Sam Weinig.

Source/WebCore:

This patch merges didFirstLayout, didFirstVisuallyNonEmptyLayout,
and didNewFirstVisuallyNonEmptyLayout. Page keeps track of which
layout milestones we are interested in with a bit mask, so that
different ports/clients can opt-into different milestones. This
will allow us to safely add more layout milestones in the future
if that seems worthwhile.

Include new file LayoutMilestoneOptions.h
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. They are now replaced
by dispatchDidLayout(LayoutMilestoneOptions)
* loader/EmptyClients.h:
(WebCore::EmptyFrameLoaderClient::dispatchDidLayout):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didLayout):
* loader/FrameLoader.h:
(FrameLoader):
* loader/FrameLoaderClient.h:
(FrameLoaderClient):
(WebCore::FrameLoaderClient::dispatchDidLayout):
* page/LayoutMilestoneOptions.h: Added.
(WebCore):

Check with Page to find out which layout milestones the client is
interested in, and then dispatch the notifications when
appropriate.
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):

Remove setRelevantRepaintedObjectsCounterThreshold(). Instead keep
track of the layout milestones bit mask.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::addLayoutMilestones):
(WebCore):
(WebCore::Page::isCountingRelevantRepaintedObjects):
(WebCore::Page::addRelevantRepaintedObject):
* page/Page.h:
(Page):
(WebCore::Page::layoutMilestones):

Source/WebKit/blackberry:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestoneOptions)
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::dispatchDidLayout):
* WebCoreSupport/FrameLoaderClientBlackBerry.h:
(FrameLoaderClientBlackBerry):

It is now necessary to opt into getting any of the
"layout milestone" notifications.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::init):

Source/WebKit/chromium:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestoneOptions)
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::dispatchDidLayout):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):

It is now necessary to opt into getting any of the
"layout milestone" notifications.
* src/WebHelperPluginImpl.cpp:
(WebKit::WebHelperPluginImpl::initPage):
* src/WebPagePopupImpl.cpp:
(WebKit::WebPagePopupImpl::initPage):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):

Source/WebKit/efl:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestoneOptions)
* WebCoreSupport/FrameLoaderClientEfl.cpp:
(WebCore::FrameLoaderClientEfl::dispatchDidLayout):
* WebCoreSupport/FrameLoaderClientEfl.h:
(FrameLoaderClientEfl):

It is now necessary to opt into getting any of the
"layout milestone" notifications.
* ewk/ewk_view.cpp:
(_ewk_view_priv_new):

Source/WebKit/gtk:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestoneOptions)
* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidLayout):
* WebCoreSupport/FrameLoaderClientGtk.h:
(FrameLoaderClient):

It is now necessary to opt into getting any of the
"layout milestone" notifications.
* webkit/webkitwebview.cpp:
(webkit_web_view_init):

Source/WebKit/mac:

The new API has two parts. First, the client has to opt into which
layout milestones they are interested in hearing about using
[WebView _layoutMilestones]. Then, WebKit will call
the WebFrameLoader delegate's didLayout(WebLayoutMilestones)
callback when the specified layout milestones have fired.
didLayout takes the WebLayoutMilestones bit mask, which will
indicate which milestones have fired since it is possible for two
to fire at the same time.

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. They are now replaced
by dispatchDidLayout(LayoutMilestones)
* WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient):
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidLayout):

Add new function to the delegate for didLayout.
* WebView/WebDelegateImplementationCaching.h:
(WebFrameLoadDelegateImplementationCache):

We need a delegate template that takes an NSUInteger.
* WebView/WebDelegateImplementationCaching.mm:
(CallDelegate):
(CallFrameLoadDelegate):

Convert between WebCore and WebKit versions of the bit mask.
* WebView/WebView.mm:
(coreLayoutMilestones):
(kitLayoutMilestones):

Add new delegate, and set the appropriate layout milestones in
WebCore based on old delegates having implementations.
(-[WebView _cacheFrameLoadDelegateImplementations]):

Call into WebCore.
(-[WebView _listenForLayoutMilestones:]):
(-[WebView _layoutMilestones]):
* WebView/WebViewInternal.h:
* WebView/WebViewPrivate.h:

Source/WebKit/qt:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestoneOptions)
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::dispatchDidLayout):
* WebCoreSupport/FrameLoaderClientQt.h:
(FrameLoaderClientQt):

It is now necessary to opt into getting any of the
"layout milestone" notifications.
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):

Source/WebKit/win:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestoneOptions)
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidLayout):
* WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient):

It is now necessary to opt into getting any of the
"layout milestone" notifications.
* WebView.cpp:
(WebView::initWithFrame):

Source/WebKit/wince:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestones)
* WebCoreSupport/FrameLoaderClientWinCE.cpp:
(WebKit::FrameLoaderClientWinCE::dispatchDidLayout):
* WebCoreSupport/FrameLoaderClientWinCE.h:
(FrameLoaderClientWinCE):

Source/WebKit/wx:

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. Their functionality
is now replaced by dispatchDidLayout(LayoutMilestones)
* WebKitSupport/FrameLoaderClientWx.cpp:
(WebCore::FrameLoaderClientWx::dispatchDidLayout):
* WebKitSupport/FrameLoaderClientWx.h:
(FrameLoaderClientWx):

Source/WebKit2:

The new API has two parts. First, the client has to opt into which
layout milestones they are interested in hearing about using
WKPageListenForLayoutMilestones or
WKBundlePageListenForLayoutMilestones(). Then, WebKit will call
the didLayout(WKLayoutMilestones) callback on the appropriate
clients when the specified layout milestones have fired. didLayout
takes the WKLayoutMilestones bit mask, which will indicate which
milestones have fired since it is possible for two to fire at the
same time.

Define WKLayoutMilestoneOptions.
* Shared/API/c/WKPageLoadTypes.h:

Define conversions between WKLayoutMilestoneOptions and
WebCore::LayoutMilestoneOptions
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toWKLayoutMilestoneOptions):
(WebKit):
(WebKit::toLayoutMilestoneOptions):

New API.
* UIProcess/API/C/WKPage.cpp:
(WKPageListenForLayoutMilestones):
* UIProcess/API/C/WKPage.h:
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::didLayout):
(WebKit):
* UIProcess/WebLoaderClient.h:
(WebLoaderClient):

didFirstLayoutForFrame, didFirstVisuallyNonEmptyLayoutForFrame,
and didNewFirstVisuallyNonEmptyLayout are now implemented with
didLayout under the hood. So if those old callbacks have been
defined, be sure to add the appropriate layout milestones here for
backwards-compatibility.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeLoaderClient):

New API.
(WebKit::WebPageProxy::listenForLayoutMilestones):
(WebKit):
(WebKit::WebPageProxy::didLayout):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:

New API. And remove the now-unnecessary
WKBundlePageSetPaintedObjectsCounterThreshold.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageListenForLayoutMilestones):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

New API.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didNewFirstVisuallyNonEmptyLayout):
(WebKit):
(WebKit::InjectedBundlePageLoaderClient::didLayout):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
(InjectedBundlePageLoaderClient):

Remove dispatchDidFirstLayout,
dispatchDidFirstVisuallyNonEmptyLayout, and
dispatchDidNewFirstVisuallyNonEmptyLayout. They are now replaced
by dispatchDidLayout(LayoutMilestoneOptions)
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidLayout):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient):

didFirstLayoutForFrame, didFirstVisuallyNonEmptyLayoutForFrame,
and didNewFirstVisuallyNonEmptyLayout are now implemented with
didLayout under the hood. So if those old callbacks have been
defined, be sure to add the appropriate layout milestones here for
backwards-compatibility.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::initializeInjectedBundleLoaderClient):
(WebKit):

Call into WebCore to set the layout milestones.
(WebKit::WebPage::listenForLayoutMilestones):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/WebPage.messages.in:

Account for the new member of PageLoadClient.
* WebProcess/qt/QtBuiltinBundlePage.cpp:
(WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):

Tools:

Account for the new member of the PageLoadClient.
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController awakeFromNib]):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

The NewFirstVisuallyNonEmptyLayoutForImages has existed for a while,
but it did not have the right target membership.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

Use new didLayout API instead of old
didNewFirstVisuallyNonEmptyLayout API.
* TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp:
(TestWebKitAPI):
(TestWebKitAPI::didLayout):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp:
(TestWebKitAPI):
(TestWebKitAPI::didLayout):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp:
(TestWebKitAPI):
(TestWebKitAPI::didLayout):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp:
(TestWebKitAPI):
(TestWebKitAPI::didLayout):
(TestWebKitAPI::setPageLoaderClient):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
88 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/EmptyClients.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/LayoutMilestones.h [new file with mode: 0644]
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
Source/WebKit/chromium/src/FrameLoaderClientImpl.h
Source/WebKit/chromium/src/WebHelperPluginImpl.cpp
Source/WebKit/chromium/src/WebPagePopupImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h
Source/WebKit/efl/ewk/ewk_view.cpp
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
Source/WebKit/gtk/webkit/webkitwebview.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebDelegateImplementationCaching.h
Source/WebKit/mac/WebView/WebDelegateImplementationCaching.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewInternal.h
Source/WebKit/mac/WebView/WebViewPrivate.h
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit/win/WebView.cpp
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/WKPageLoadTypes.h
Source/WebKit2/Shared/API/c/WKSharedAPICast.h
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/WebLoaderClient.cpp
Source/WebKit2/UIProcess/WebLoaderClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/qt/QtBuiltinBundlePage.cpp
Tools/ChangeLog
Tools/MiniBrowser/mac/BrowserWindowController.m
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/TestController.cpp