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: http://svn.webkit.org/repository/webkit/trunk@106492
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-01 Beth Dakin <bdakin@apple.com>
+
+ 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.
+
+ 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):
+
2012-02-01 Alexis Menard <alexis.menard@openbossa.org>
CSSStyleDeclaration.getPropertyPriority() fails for CSS shorthand properties with 'important' priority
__ZN7WebCore4Page31setCustomHTMLTokenizerTimeDelayEd
__ZN7WebCore4Page32setMemoryCacheClientCallsEnabledEb
__ZN7WebCore4Page37setInLowQualityImageInterpolationModeEb
+__ZN7WebCore4Page43setRelevantRepaintedObjectsCounterThresholdEy
__ZN7WebCore4Page6goBackEv
__ZN7WebCore4Page8goToItemEPNS_11HistoryItemENS_13FrameLoadTypeE
__ZN7WebCore4Page9goForwardEv
virtual void dispatchDidFinishLoad() { }
virtual void dispatchDidFirstLayout() { }
virtual void dispatchDidFirstVisuallyNonEmptyLayout() { }
+ virtual void dispatchDidNewFirstVisuallyNonEmptyLayout() { }
virtual Frame* dispatchCreatePage(const NavigationAction&) { return 0; }
virtual void dispatchShow() { }
m_client->dispatchDidFirstVisuallyNonEmptyLayout();
}
+void FrameLoader::didNewFirstVisuallyNonEmptyLayout()
+{
+ m_client->dispatchDidNewFirstVisuallyNonEmptyLayout();
+}
+
void FrameLoader::frameLoadCompleted()
{
// Note: Can be called multiple times.
CachePolicy subresourceCachePolicy() const;
void didFirstLayout();
+
+ // FIXME: didFirstVisuallyNonEmptyLayout() and didNewFirstVisuallyNonEmptyLayout() should be merged.
+ // The only reason for both to exist is to experiment with different heuristics for the time being.
void didFirstVisuallyNonEmptyLayout();
+ void didNewFirstVisuallyNonEmptyLayout();
void loadedResourceFromMemoryCache(CachedResource*);
void tellClientAboutPastMemoryCacheLoads();
virtual void dispatchDidFirstLayout() = 0;
virtual void dispatchDidFirstVisuallyNonEmptyLayout() = 0;
+ virtual void dispatchDidNewFirstVisuallyNonEmptyLayout() { }
virtual void dispatchDidLayout() { }
virtual Frame* dispatchCreatePage(const NavigationAction&) = 0;
if (m_firstLayoutCallbackPending) {
m_firstLayoutCallbackPending = false;
m_frame->loader()->didFirstLayout();
+ if (Page* page = m_frame->page())
+ page->startCountingRelevantRepaintedObjects();
}
// Ensure that we always send this eventually.
, m_visibilityState(PageVisibilityStateVisible)
#endif
, m_displayID(0)
+ , m_isCountingRelevantRepaintedObjects(false)
{
if (!allPages) {
allPages = new HashSet<Page*>;
}
#endif
+static uint64_t gPaintedObjectCounterThreshold = 0;
+
+void Page::setRelevantRepaintedObjectsCounterThreshold(uint64_t threshold)
+{
+ gPaintedObjectCounterThreshold = threshold;
+}
+
+void Page::startCountingRelevantRepaintedObjects()
+{
+ m_isCountingRelevantRepaintedObjects = true;
+
+ // Clear the HashSet in case we didn't hit the threshold last time.
+ m_relevantPaintedRenderObjects.clear();
+}
+
+void Page::addRelevantRepaintedObject(RenderObject* object, const IntRect& objectPaintRect)
+{
+ if (!m_isCountingRelevantRepaintedObjects)
+ return;
+
+ // We don't need to do anything if there is no counter threshold.
+ if (!gPaintedObjectCounterThreshold)
+ return;
+
+ // The objects are only relevant if they are being painted within the viewRect().
+ if (RenderView* view = object->view()) {
+ if (!objectPaintRect.intersects(view->viewRect()))
+ return;
+ }
+
+ m_relevantPaintedRenderObjects.add(object);
+
+ if (m_relevantPaintedRenderObjects.size() == static_cast<int>(gPaintedObjectCounterThreshold)) {
+ m_isCountingRelevantRepaintedObjects = false;
+ m_relevantPaintedRenderObjects.clear();
+ if (Frame* frame = mainFrame())
+ frame->loader()->didNewFirstVisuallyNonEmptyLayout();
+ }
+}
+
Page::PageClients::PageClients()
: chromeClient(0)
, contextMenuClient(0)
class PointerLockController;
class ProgressTracker;
class Range;
+ class RenderObject;
class RenderTheme;
class VisibleSelection;
class ScrollableArea;
#endif
PlatformDisplayID displayID() const { return m_displayID; }
+
+ void setRelevantRepaintedObjectsCounterThreshold(uint64_t);
+ void startCountingRelevantRepaintedObjects();
+ void addRelevantRepaintedObject(RenderObject*, const IntRect& objectPaintRect);
private:
void initGroup();
PageVisibilityState m_visibilityState;
#endif
PlatformDisplayID m_displayID;
+
+ HashSet<RenderObject*> m_relevantPaintedRenderObjects;
+ bool m_isCountingRelevantRepaintedObjects;
};
} // namespace WebCore
#include "config.h"
#include "InlineBox.h"
+#include "Frame.h"
#include "HitTestResult.h"
#include "InlineFlowBox.h"
+#include "Page.h"
#include "PaintInfo.h"
#include "RenderArena.h"
#include "RenderBlock.h"
if (!paintInfo.shouldPaintWithinRoot(renderer()) || (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection))
return;
+ if (Frame* frame = renderer()->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(renderer(), paintInfo.rect);
+ }
+
LayoutPoint childPoint = paintOffset;
if (parent()->renderer()->style()->isFlippedBlocksWritingMode()) // Faster than calling containingBlock().
childPoint = renderer()->containingBlock()->flipForWritingModeForChild(toRenderBox(renderer()), childPoint);
// When only painting the selection, don't bother to paint if there is none.
return;
+ if (Frame* frame = renderer()->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(renderer(), paintInfo.rect);
+ }
+
if (m_truncation != cNoTruncation) {
if (renderer()->containingBlock()->style()->isLeftToRightDirection() != isLeftToRightDirection()) {
// Make the visible fragment of text hug the edge closest to the rest of the run by moving the origin
float textWidth;
if (!getReplacementTextGeometry(paintOffset, contentRect, path, replacementTextRect, font, run, textWidth))
return;
+
+ if (Frame* frame = this->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(this, paintInfo.rect);
+ }
GraphicsContextStateSaver stateSaver(*context);
context->clip(contentRect);
#include "CanvasRenderingContext.h"
#include "Document.h"
+#include "Frame.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLCanvasElement.h"
#include "HTMLNames.h"
+#include "Page.h"
#include "PaintInfo.h"
#include "RenderView.h"
void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
+ if (Frame* frame = this->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(this, paintInfo.rect);
+ }
+
LayoutRect rect = contentBoxRect();
rect.moveBy(paintOffset);
bool useLowQualityScale = style()->imageRendering() == ImageRenderingOptimizeContrast;
if (!img || img->isNull())
return;
+ if (Frame* frame = this->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(this, paintInfo.rect);
+ }
+
#if PLATFORM(MAC)
if (style()->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
paintCustomHighlight(toPoint(paintOffset - location()), style()->highlight(), true);
if (!m_flowThread || !isValid())
return;
+ if (Frame* frame = this->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(this, paintInfo.rect);
+ }
+
#ifndef NDEBUG
m_insideRegionPaint = true;
#endif
#include "config.h"
#include "RenderReplaced.h"
+#include "Frame.h"
#include "GraphicsContext.h"
#include "LayoutRepainter.h"
+#include "Page.h"
#include "RenderBlock.h"
#include "RenderLayer.h"
#include "RenderTheme.h"
drawSelectionTint = false;
}
+ if (Frame* frame = this->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(this, paintInfo.rect);
+ }
+
bool completelyClippedOut = false;
if (style()->hasBorderRadius()) {
LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size());
#include "RenderVideo.h"
#include "Document.h"
+#include "Frame.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLNames.h"
#include "HTMLVideoElement.h"
#include "MediaPlayer.h"
+#include "Page.h"
#include "PaintInfo.h"
#include "RenderView.h"
return;
rect.moveBy(paintOffset);
+ if (Frame* frame = this->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(this, paintInfo.rect);
+ }
+
if (displayingPoster)
paintIntoRect(paintInfo.context, rect);
else if (document()->view() && document()->view()->paintBehavior() & PaintBehaviorFlattenCompositingLayers)
return;
}
+ if (Frame* frame = this->frame()) {
+ if (Page* page = frame->page())
+ page->addRelevantRepaintedObject(this, paintInfo.rect);
+ }
+
// Make a copy of the PaintInfo because applyTransform will modify the damage rect.
PaintInfo childPaintInfo(paintInfo);
childPaintInfo.context->save();
+2012-02-01 Beth Dakin <bdakin@apple.com>
+
+ 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.
+
+ 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):
+
2012-01-31 Alexey Proskuryakov <ap@apple.com>
REGRESSION (WebKit2): event.keyCode is always zero when typing in Russian
typedef void (*WKPageDidChangeBackForwardListCallback)(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo);
typedef bool (*WKPageShouldGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, const void *clientInfo);
typedef void (*WKPageDidFailToInitializePluginCallback)(WKPageRef page, WKStringRef mimeType, const void* clientInfo);
+typedef void (*WKPageDidNewFirstVisuallyNonEmptyLayoutCallback)(WKPageRef page, WKTypeRef userData, const void *clientInfo);
struct WKPageLoaderClient {
int version;
// Version 1
WKPageDidDetectXSSForFrameCallback didDetectXSSForFrame;
+
+ // FIXME: didFirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged.
+ WKPageDidNewFirstVisuallyNonEmptyLayoutCallback didNewFirstVisuallyNonEmptyLayout;
};
typedef struct WKPageLoaderClient WKPageLoaderClient;
m_client.didFirstVisuallyNonEmptyLayoutForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.clientInfo);
}
+void WebLoaderClient::didNewFirstVisuallyNonEmptyLayout(WebPageProxy* page, APIObject* userData)
+{
+ if (!m_client.didNewFirstVisuallyNonEmptyLayout)
+ return;
+
+ m_client.didNewFirstVisuallyNonEmptyLayout(toAPI(page), toAPI(userData), m_client.clientInfo);
+}
+
void WebLoaderClient::didRemoveFrameFromHierarchy(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)
{
if (!m_client.didRemoveFrameFromHierarchy)
void didDisplayInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
void didRunInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
void didDetectXSSForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
+
+ // FIXME: didFirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged.
+ // The only reason for both to exist is to experiment with different heuristics for the time being.
+ void didNewFirstVisuallyNonEmptyLayout(WebPageProxy*, APIObject*);
bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy*, WebFrameProxy*, WebProtectionSpace*);
void didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy*);
m_loaderClient.didFirstVisuallyNonEmptyLayoutForFrame(this, frame, userData.get());
}
+void WebPageProxy::didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder* arguments)
+{
+ RefPtr<APIObject> userData;
+ WebContextUserMessageDecoder messageDecoder(userData, m_process->context());
+ if (!arguments->decode(messageDecoder))
+ return;
+
+ m_loaderClient.didNewFirstVisuallyNonEmptyLayout(this, userData.get());
+}
+
void WebPageProxy::didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder* arguments)
{
RefPtr<APIObject> userData;
void didReceiveTitleForFrame(uint64_t frameID, const String&, CoreIPC::ArgumentDecoder*);
void didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
void didFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
+ void didNewFirstVisuallyNonEmptyLayout(CoreIPC::ArgumentDecoder*);
void didRemoveFrameFromHierarchy(uint64_t frameID, CoreIPC::ArgumentDecoder*);
void didDisplayInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
void didRunInsecureContentForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*);
DidFinishLoadForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData)
DidFirstLayoutForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData)
DidFirstVisuallyNonEmptyLayoutForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData)
+ DidNewFirstVisuallyNonEmptyLayout(WebKit::InjectedBundleUserMessageEncoder userData)
DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, WTF::String url, WebKit::InjectedBundleUserMessageEncoder userData)
DidRemoveFrameFromHierarchy(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData)
DidStartProvisionalLoadForFrame(uint64_t frameID, WTF::String url, WTF::String unreachableURL, WebKit::InjectedBundleUserMessageEncoder userData)
return toImpl(pageRef)->renderTreeSize();
}
+void WKBundlePageSetPaintedObjectsCounterThreshold(WKBundlePageRef page, uint64_t threshold)
+{
+ toImpl(page)->setPaintedObjectsCounterThreshold(threshold);
+}
+
void WKBundlePageSetTracksRepaints(WKBundlePageRef pageRef, bool trackRepaints)
{
toImpl(pageRef)->setTracksRepaints(trackRepaints);
WK_EXPORT uint64_t WKBundlePageGetRenderTreeSize(WKBundlePageRef page);
+// FIXME: This is temporary. Ultimately WebKit should choose the threshold itself.
+WK_EXPORT void WKBundlePageSetPaintedObjectsCounterThreshold(WKBundlePageRef page, uint64_t threshold);
+
WK_EXPORT void WKBundlePageSetTracksRepaints(WKBundlePageRef page, bool trackRepaints);
WK_EXPORT bool WKBundlePageIsTrackingRepaints(WKBundlePageRef page);
WK_EXPORT void WKBundlePageResetTrackedRepaints(WKBundlePageRef page);
webPage->send(Messages::WebPageProxy::DidFirstVisuallyNonEmptyLayoutForFrame(m_frame->frameID(), InjectedBundleUserMessageEncoder(userData.get())));
}
+void WebFrameLoaderClient::dispatchDidNewFirstVisuallyNonEmptyLayout()
+{
+ WebPage* webPage = m_frame->page();
+ if (!webPage)
+ return;
+
+ RefPtr<APIObject> userData;
+
+ // Notify the UIProcess.
+ webPage->send(Messages::WebPageProxy::DidNewFirstVisuallyNonEmptyLayout(InjectedBundleUserMessageEncoder(userData.get())));
+}
+
void WebFrameLoaderClient::dispatchDidLayout()
{
WebPage* webPage = m_frame->page();
virtual void dispatchDidFirstLayout() OVERRIDE;
virtual void dispatchDidFirstVisuallyNonEmptyLayout() OVERRIDE;
+ virtual void dispatchDidNewFirstVisuallyNonEmptyLayout() OVERRIDE;
virtual void dispatchDidLayout() OVERRIDE;
virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&) OVERRIDE;
return size;
}
+void WebPage::setPaintedObjectsCounterThreshold(uint64_t threshold)
+{
+ if (!m_page)
+ return;
+ m_page->setRelevantRepaintedObjectsCounterThreshold(threshold);
+}
+
void WebPage::setTracksRepaints(bool trackRepaints)
{
if (FrameView* view = mainFrameView())
String renderTreeExternalRepresentation() const;
uint64_t renderTreeSize() const;
+ void setPaintedObjectsCounterThreshold(uint64_t);
void setTracksRepaints(bool);
bool isTrackingRepaints() const;
+2012-02-01 Beth Dakin <bdakin@apple.com>
+
+ 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.
+
+ 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):
+
2012-02-01 Dirk Pranke <dpranke@chromium.org>
TestWebKitAPI isn't being built on chromium bots any more
0, // shouldGoToBackForwardItem
0, // didFailToInitializePlugin
didDetectXSSForFrame,
+ 0, // didNewFirstVisuallyNonEmptyLayout
};
WKPageSetPageLoaderClient(_webView.pageRef, &loadClient);
0, // didChangeBackForwardList
0, // shouldGoToBackForwardListItem
0, // didRunInsecureContentForFrame
- 0 // didDetectXSSForFrame
+ 0, // didDetectXSSForFrame
+ 0 // didNewFirstVisuallyNonEmptyLayout
};
WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
}