https://bugs.webkit.org/show_bug.cgi?id=77383
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 21:52:41 +0000 (21:52 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Feb 2012 21:52:41 +0000 (21:52 +0000)
commitec0650b29a2b2acc61f598832f2cad15dde772a8
tree459c800b2a7a54f1943544b6f67840e1ab9d8c18
parent8eac8dd57d1363662c9102f7bad6707c6ccd4021
https://bugs.webkit.org/show_bug.cgi?id=77383
Add a different didFirstVisuallNonEmptyLayout heuristic to experiment with
-and corresponding-
<rdar://problem/10709560>

Reviewed by Sam Weinig.

Source/WebCore:

The goal is to re-vamp didFirstVisuallyNonEmptyLayout to be more accurate.
This patch adds a new heuristic called didNewFirstVisuallNonEmptyLayout and
leaves the old one for the time being. That is temporary.

The heuristic for didNewFirstVisuallNonEmptyLayout is to count relevant
painted RenderObjects on Page.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setPaintedObjectsCounterThreshold):
(WebCore::Page::addRelevantRepaintedObject):
* page/Page.h:
(WebCore):
(Page):
(WebCore::Page::startCountingRepaintedObjects):
* WebCore.exp.in:

Start counting relevant painted RenderObjects on the page once the first
layout is complete.
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):

Machinery for firing didNewFirstVisuallNonEmptyLayout.
* loader/EmptyClients.h:
(WebCore::EmptyFrameLoaderClient::dispatchDidNewFirstVisuallyNonEmptyLayout):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didNewFirstVisuallyNonEmptyLayout):
(WebCore):
* loader/FrameLoader.h:
(FrameLoader):
* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::dispatchDidNewFirstVisuallyNonEmptyLayout):

These RenderObjects are the ones that this api currently consider to be
relevant. If their repaint rects intersect with the viewRect, then they are
added to the relevant objects set on the Page.
* rendering/InlineBox.cpp:
(WebCore::InlineBox::paint):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintReplaced):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::paintReplaced):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):

Source/WebKit2:

Machinery for didNewFirstVisuallNonEmptyLayout.
* UIProcess/API/C/WKPage.h:
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::didNewFirstVisuallyNonEmptyLayout):
(WebKit):
* UIProcess/WebLoaderClient.h:
(WebLoaderClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didNewFirstVisuallyNonEmptyLayout):
(WebKit):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidNewFirstVisuallyNonEmptyLayout):
(WebKit):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient):

This temporary API allows the client to specify the threshold for the painted
objects counter on Page. This is temporary.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetPaintedObjectsCounterThreshold):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setPaintedObjectsCounterThreshold):
(WebKit):
* WebProcess/WebPage/WebPage.h:
(WebPage):

Tools:

WebKit2's WebLoaderClient has a temporary new function that must be accounted
for.
* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController awakeFromNib]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
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/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/rendering/InlineBox.cpp
Source/WebCore/rendering/InlineTextBox.cpp
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderRegion.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderVideo.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebKit2/ChangeLog
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/WKBundlePagePrivate.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
Tools/ChangeLog
Tools/MiniBrowser/mac/BrowserWindowController.m
Tools/WebKitTestRunner/TestController.cpp