<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174231] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174231">174231</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2014-10-02 14:06:14 -0700 (Thu, 02 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move PageOverlay[Controller] to WebCore
https://bugs.webkit.org/show_bug.cgi?id=137164
&lt;rdar://problem/18508258&gt;

Reviewed by Anders Carlsson.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Make the appropriate build system changes.

* WebCore.exp.in:
Export the new PageOverlay[Controller] symbols from WebCore.

* loader/EmptyClients.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
to push view-relative page overlay root layers down to WebKit to be
installed just inside the view.

Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
talk directly to PageOverlayController.

* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::mouseMoved):
(WebCore::EventHandler::handleMouseReleaseEvent):
When the mouse is moved, pressed, or released, give PageOverlayController
the first shot at handling the event.

* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
Inform PageOverlayController that the main FrameView's size changed,
so it can update the size of view-relative overlays.

(WebCore::FrameView::setContentsSize):
Inform PageOverlayController that the main FrameView's contents size changed,
so it can update the size of document-relative overlays.

(WebCore::FrameView::setFixedVisibleContentRect):
(WebCore::FrameView::didChangeScrollOffset):
(WebCore::FrameView::scrollTo):
(WebCore::FrameView::wheelEvent):
Inform PageOverlayController that something scrolled.

(WebCore::FrameView::setExposedRect):
Inform PageOverlayController that the exposed rect changed, so it can push
the new exposed rect down to the overlays.

* page/FrameView.h:
Add didChangeScrollOffset.

* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
* page/MainFrame.h:
Keep one PageOverlayController per MainFrame.

* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
Inform PageOverlayController that the device scale factor changed.

(WebCore::Page::setSessionID):
Remove a blank line.

* page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
Move PageOverlay from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
    - references instead of pointers in many places
    - WebCore types instead of WebKit2 types everywhere

(WebCore::PageOverlay::bounds):
It is possible to install an overlay before we have a FrameView.
We will eventually get a view/contents size changed notification and try again.

(WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebCore::PageOverlay::copyAccessibilityAttributeNames):
Split copyAccessibilityAttribute into &quot;StringValueForPoint&quot; and &quot;BoolValueForPoint&quot;
variants, because we don't have anything like WKTypeRef here.

* page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
Leave a comment noting that we should move the PageOverlay's GraphicsLayer
to PageOverlay instead of a map on PageOverlayController.

* page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
Move PageOverlayController from WebKit2 to WebCore.
A few overarching changes that I won't detail in each place:
    - references instead of pointers in many places
    - WebCore types instead of WebKit2 types everywhere

Leave a FIXME that didChangeSettings is not currently called when settings change.
This is not a problem for normal use of overlays, only for dynamically changing
layer border/repaint counter settings.

(WebCore::PageOverlayController::PageOverlayController):
(WebCore::PageOverlayController::createRootLayersIfNeeded):
We will now lazily initialize the root layers when we first try to use them,
because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.

(WebCore::PageOverlayController::installPageOverlay):
Enter compositing mode when installing a PageOverlay.
Avoid pushing the Page to the PageOverlay until after we've set up
its root layer, so that the installation process can make use of that layer;
clients may, for example, expect to be able to setNeedsDisplay() in the
didMoveToPage callback.
Avoid updateOverlayGeometry until the layer is created and we've pushed
the Page down, so that e.g. bounds() will use the right Page.

(WebCore::PageOverlayController::didChangeSettings):
Leave a FIXME about a future improvement to didChangeSettings.

(WebCore::PageOverlayController::deviceScaleFactor):
(WebCore::PageOverlayController::notifyFlushRequired):
Null-check Page; these can get called when tearing down the Frame.

* page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.

* platform/graphics/GraphicsLayerClient.h:
Add wtf/Forward.h, because GraphicsLayerClient.h uses String.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
Inform PageOverlayController that something scrolled.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
because we need to avoid falling out of compositing mode if we still have
page overlays.

(WebCore::RenderLayerCompositor::updateCompositingLayers):
Enter compositing mode if we have page overlays.

(WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
Rename appendOverlayLayers -&gt; appendDocumentOverlayLayers.

(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
Attach/detach the view overlay root layer when attaching/detaching the
normal compositing root layer.

(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:

* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:
Make the appropriate build system changes.

* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
(WKBundlePageUninstallPageOverlay):
(WKBundlePageInstallPageOverlayWithAnimation):
(WKBundlePageUninstallPageOverlayWithAnimation):
Forward PageOverlay installation/uninstallation to WebCore.

* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
(WKBundlePageOverlaySetAccessibilityClient):
Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.

(PageOverlayClientImpl::copyAccessibilityAttributeValue):
(PageOverlayClientImpl::copyAccessibilityAttributeNames):
Convert from wtf types to WebKit2 types.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::graphicsLayerFactory):
If we don't have a drawing area, don't dereference it!

(WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
Forward attachViewOverlayGraphicsLayer to the DrawingArea.

* WebProcess/WebCoreSupport/WebChromeClient.h:

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/FindController.cpp:
* WebProcess/WebPage/FindController.h:
* WebProcess/WebPage/ios/FindControllerIOS.mm:
* WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
* WebProcess/WebPage/ServicesOverlayController.h:
Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.

* WebProcess/WebPage/LayerTreeHost.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
Remove support for WebKit2-based page overlays.
Return MainFrame instead of Frame from mainFrame().

* WebProcess/WebPage/WebPageOverlay.cpp: Added.
* WebProcess/WebPage/WebPageOverlay.h: Added.
(WebKit::WebPageOverlay::create):
(WebKit::WebPageOverlay::WebPageOverlay):
(WebKit::WebPageOverlay::~WebPageOverlay):
(WebKit::WebPageOverlay::setNeedsDisplay):
(WebKit::WebPageOverlay::clear):
(WebKit::WebPageOverlay::pageOverlayDestroyed):
(WebKit::WebPageOverlay::willMoveToPage):
(WebKit::WebPageOverlay::didMoveToPage):
(WebKit::WebPageOverlay::drawRect):
(WebKit::WebPageOverlay::mouseEvent):
(WebKit::WebPageOverlay::didScrollFrame):
(WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
(WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
WebPageOverlay exists to be our API object, but forwards everything
to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
forwards client callbacks to its WebPageOverlay::Client (which
WKBundlePageOverlay implements).

* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
Forward the three AX properties that PageOverlays are ever queried for
to the appropriate PageOverlayController function.

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.

(WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
If we attach/detach the view-relative page overlay root layer,
reattach the root compositing layer's children.

(WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
Ditto for the root compositing layer.

(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
Factor updateRootLayers out of setRootCompositingLayer.

(WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.

(WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
Informing PageOverlayController of exposed rect/document size changes is now
WebCore's job.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attachViewOverlayGraphicsLayer):

* Shared/WebRenderLayer.cpp:
* Shared/WebRenderObject.cpp:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
* WebProcess/WebProcess.cpp:
Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::attachViewOverlayGraphicsLayer):
Add an empty ChromeClient override.

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::attachViewOverlayGraphicsLayer):
* WebCoreSupport/WebChromeClient.h:
Add an empty ChromeClient override.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebCorepageMainFramecpp">trunk/Source/WebCore/page/MainFrame.cpp</a></li>
<li><a href="#trunkSourceWebCorepageMainFrameh">trunk/Source/WebCore/page/MainFrame.h</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerClienth">trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorh">trunk/Source/WebCore/rendering/RenderLayerCompositor.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebChromeClienth">trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebRenderLayercpp">trunk/Source/WebKit2/Shared/WebRenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebRenderObjectcpp">trunk/Source/WebKit2/Shared/WebRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundleAPICasth">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePageOverlaycpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebEditorClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageFindControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageFindControllerh">trunk/Source/WebKit2/WebProcess/WebPage/FindController.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageLayerTreeHosth">trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageServicesOverlayControllerh">trunk/Source/WebKit2/WebProcess/WebPage/ServicesOverlayController.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosFindControllerIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/FindControllerIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosFindIndicatorOverlayClientIOSh">trunk/Source/WebKit2/WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacServicesOverlayControllermm">trunk/Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreah">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm">trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWKAccessibilityWebPageObjectMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorepagePageOverlaycpp">trunk/Source/WebCore/page/PageOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageOverlayh">trunk/Source/WebCore/page/PageOverlay.h</a></li>
<li><a href="#trunkSourceWebCorepagePageOverlayControllercpp">trunk/Source/WebCore/page/PageOverlayController.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageOverlayControllerh">trunk/Source/WebCore/page/PageOverlayController.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageOverlaycpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageOverlayh">trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2WebProcessWebPagePageOverlaycpp">trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagePageOverlayh">trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagePageOverlayControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagePageOverlayControllerh">trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1940,6 +1940,8 @@
</span><span class="cx">     page/PageConsoleClient.cpp
</span><span class="cx">     page/PageGroup.cpp
</span><span class="cx">     page/PageGroupLoadDeferrer.cpp
</span><ins>+    page/PageOverlay.cpp
+    page/PageOverlayController.cpp
</ins><span class="cx">     page/PageSerializer.cpp
</span><span class="cx">     page/PageThrottler.cpp
</span><span class="cx">     page/PageVisibilityState.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/ChangeLog        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,3 +1,154 @@
</span><ins>+2014-10-02  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Move PageOverlay[Controller] to WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=137164
+        &lt;rdar://problem/18508258&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        Make the appropriate build system changes.
+
+        * WebCore.exp.in:
+        Export the new PageOverlay[Controller] symbols from WebCore.
+
+        * loader/EmptyClients.h:
+        * page/ChromeClient.h:
+        (WebCore::ChromeClient::documentOverlayLayerForFrame): Deleted.
+        Add attachViewOverlayGraphicsLayer, which allows PageOverlayController
+        to push view-relative page overlay root layers down to WebKit to be
+        installed just inside the view.
+
+        Remove documentOverlayLayerForFrame because RenderLayerCompositor can now
+        talk directly to PageOverlayController.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::EventHandler::mouseMoved):
+        (WebCore::EventHandler::handleMouseReleaseEvent):
+        When the mouse is moved, pressed, or released, give PageOverlayController
+        the first shot at handling the event.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setFrameRect):
+        Inform PageOverlayController that the main FrameView's size changed,
+        so it can update the size of view-relative overlays.
+
+        (WebCore::FrameView::setContentsSize):
+        Inform PageOverlayController that the main FrameView's contents size changed,
+        so it can update the size of document-relative overlays.
+
+        (WebCore::FrameView::setFixedVisibleContentRect):
+        (WebCore::FrameView::didChangeScrollOffset):
+        (WebCore::FrameView::scrollTo):
+        (WebCore::FrameView::wheelEvent):
+        Inform PageOverlayController that something scrolled.
+
+        (WebCore::FrameView::setExposedRect):
+        Inform PageOverlayController that the exposed rect changed, so it can push
+        the new exposed rect down to the overlays.
+
+        * page/FrameView.h:
+        Add didChangeScrollOffset.
+
+        * page/MainFrame.cpp:
+        (WebCore::MainFrame::MainFrame):
+        * page/MainFrame.h:
+        Keep one PageOverlayController per MainFrame.
+
+        * page/Page.cpp:
+        (WebCore::Page::setDeviceScaleFactor):
+        Inform PageOverlayController that the device scale factor changed.
+
+        (WebCore::Page::setSessionID):
+        Remove a blank line.
+
+        * page/PageOverlay.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp.
+        Move PageOverlay from WebKit2 to WebCore.
+        A few overarching changes that I won't detail in each place:
+            - references instead of pointers in many places
+            - WebCore types instead of WebKit2 types everywhere
+
+        (WebCore::PageOverlay::bounds):
+        It is possible to install an overlay before we have a FrameView.
+        We will eventually get a view/contents size changed notification and try again.
+
+        (WebCore::PageOverlay::copyAccessibilityAttributeStringValueForPoint):
+        (WebCore::PageOverlay::copyAccessibilityAttributeBoolValueForPoint):
+        (WebCore::PageOverlay::copyAccessibilityAttributeNames):
+        Split copyAccessibilityAttribute into &quot;StringValueForPoint&quot; and &quot;BoolValueForPoint&quot;
+        variants, because we don't have anything like WKTypeRef here.
+
+        * page/PageOverlay.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlay.h.
+        Make PageOverlay a normal RefCounted object instead of a WebKit2 API object.
+        Leave a comment noting that we should move the PageOverlay's GraphicsLayer
+        to PageOverlay instead of a map on PageOverlayController.
+
+        * page/PageOverlayController.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp.
+        Move PageOverlayController from WebKit2 to WebCore.
+        A few overarching changes that I won't detail in each place:
+            - references instead of pointers in many places
+            - WebCore types instead of WebKit2 types everywhere
+
+        Leave a FIXME that didChangeSettings is not currently called when settings change.
+        This is not a problem for normal use of overlays, only for dynamically changing
+        layer border/repaint counter settings.
+
+        (WebCore::PageOverlayController::PageOverlayController):
+        (WebCore::PageOverlayController::createRootLayersIfNeeded):
+        We will now lazily initialize the root layers when we first try to use them,
+        because otherwise we try to create them before the ChromeClient's GraphicsLayerFactory
+        is hooked up, in some cases, and that can cause us to create the wrong kind of GraphicsLayers.
+
+        (WebCore::PageOverlayController::installPageOverlay):
+        Enter compositing mode when installing a PageOverlay.
+        Avoid pushing the Page to the PageOverlay until after we've set up
+        its root layer, so that the installation process can make use of that layer;
+        clients may, for example, expect to be able to setNeedsDisplay() in the
+        didMoveToPage callback.
+        Avoid updateOverlayGeometry until the layer is created and we've pushed
+        the Page down, so that e.g. bounds() will use the right Page.
+
+        (WebCore::PageOverlayController::didChangeSettings):
+        Leave a FIXME about a future improvement to didChangeSettings.
+
+        (WebCore::PageOverlayController::deviceScaleFactor):
+        (WebCore::PageOverlayController::notifyFlushRequired):
+        Null-check Page; these can get called when tearing down the Frame.
+
+        * page/PageOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/PageOverlayController.h.
+
+        * platform/graphics/GraphicsLayerClient.h:
+        Add wtf/Forward.h, because GraphicsLayerClient.h uses String.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::scrollTo):
+        Inform PageOverlayController that something scrolled.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers):
+        Make hasAnyAdditionalCompositedLayers return true if there are any page overlays,
+        because we need to avoid falling out of compositing mode if we still have
+        page overlays.
+
+        (WebCore::RenderLayerCompositor::updateCompositingLayers):
+        Enter compositing mode if we have page overlays.
+
+        (WebCore::RenderLayerCompositor::appendOverlayLayers): Deleted.
+        (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
+        Rename appendOverlayLayers -&gt; appendDocumentOverlayLayers.
+
+        (WebCore::RenderLayerCompositor::attachRootLayer):
+        (WebCore::RenderLayerCompositor::detachRootLayer):
+        Attach/detach the view overlay root layer when attaching/detaching the
+        normal compositing root layer.
+
+        (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
+        * rendering/RenderLayerCompositor.h:
+
</ins><span class="cx"> 2014-10-02  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Back TextRun with a StringView
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -187,6 +187,13 @@
</span><span class="cx"> __ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE
</span><span class="cx"> __ZN7WebCore11MemoryCache20removeImageFromCacheERKNS_3URLERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE
</span><ins>+__ZN7WebCore11PageOverlay15setNeedsDisplayERKNS_7IntRectE
+__ZN7WebCore11PageOverlay15setNeedsDisplayEv
+__ZN7WebCore11PageOverlay20stopFadeOutAnimationEv
+__ZN7WebCore11PageOverlay5clearEv
+__ZN7WebCore11PageOverlay5layerEv
+__ZN7WebCore11PageOverlay6createERNS0_6ClientENS0_11OverlayTypeE
+__ZN7WebCore11PageOverlay8setFrameENS_7IntRectE
</ins><span class="cx"> __ZN7WebCore11SQLResultOkE
</span><span class="cx"> __ZN7WebCore11URLWithDataEP6NSDataP5NSURL
</span><span class="cx"> __ZN7WebCore11getURLBytesEPK7__CFURLRN3WTF6VectorIcLm512ENS3_15CrashOnOverflowEEE
</span><span class="lines">@@ -909,6 +916,12 @@
</span><span class="cx"> __ZN7WebCore21NetworkStorageSession21defaultStorageSessionEv
</span><span class="cx"> __ZN7WebCore21NetworkStorageSession25switchToNewTestingSessionEv
</span><span class="cx"> __ZN7WebCore21NetworkStorageSession28createPrivateBrowsingSessionERKN3WTF6StringE
</span><ins>+__ZN7WebCore21PageOverlayController18installPageOverlayEN3WTF10PassRefPtrINS_11PageOverlayEEENS3_8FadeModeE
+__ZN7WebCore21PageOverlayController20uninstallPageOverlayEPNS_11PageOverlayENS1_8FadeModeE
+__ZN7WebCore21PageOverlayController20viewOverlayRootLayerEv
+__ZN7WebCore21PageOverlayController32copyAccessibilityAttributesNamesEb
+__ZN7WebCore21PageOverlayController43copyAccessibilityAttributeBoolValueForPointEN3WTF6StringENS_10FloatPointERb
+__ZN7WebCore21PageOverlayController45copyAccessibilityAttributeStringValueForPointEN3WTF6StringENS_10FloatPointERS2_
</ins><span class="cx"> __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS_13PlatformEvent4TypeEb
</span><span class="cx"> __ZN7WebCore21RemoteCommandListener6createERNS_27RemoteCommandListenerClientE
</span><span class="cx"> __ZN7WebCore21ResourceLoadScheduler20servePendingRequestsENS_20ResourceLoadPriorityE
</span><span class="lines">@@ -1603,6 +1616,8 @@
</span><span class="cx"> __ZNK7WebCore11HistoryItem8referrerEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem9urlStringEv
</span><span class="cx"> __ZNK7WebCore11HistoryItem9viewStateEv
</span><ins>+__ZNK7WebCore11PageOverlay5frameEv
+__ZNK7WebCore11PageOverlay6boundsEv
</ins><span class="cx"> __ZNK7WebCore11RenderBlock25inlineElementContinuationEv
</span><span class="cx"> __ZNK7WebCore11RenderLayer19absoluteBoundingBoxEv
</span><span class="cx"> __ZNK7WebCore11RenderLayer24needsCompositedScrollingEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -7180,6 +7180,8 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageConsoleClient.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageGroup.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageGroupLoadDeferrer.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\PageOverlay.cpp&quot; /&gt;
+    &lt;ClCompile Include=&quot;..\page\PageOverlayController.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageSerializer.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageThrottler.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageVisibilityState.cpp&quot; /&gt;
</span><span class="lines">@@ -19175,6 +19177,8 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\PageConsoleClient.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\PageGroup.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\PageGroupLoadDeferrer.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\PageOverlay.h&quot; /&gt;
+    &lt;ClInclude Include=&quot;..\page\PageOverlayController.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\PageSerializer.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\PageVisibilityState.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\Performance.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -4998,6 +4998,12 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageGroupLoadDeferrer.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\page\PageOverlay.cpp&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
+    &lt;ClCompile Include=&quot;..\page\PageOverlayController.cpp&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\page\PageSerializer.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -12943,6 +12949,12 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\page\PageGroupLoadDeferrer.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\page\PageOverlay.h&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
+    &lt;ClInclude Include=&quot;..\page\PageOverlayController.h&quot;&gt;
+      &lt;Filter&gt;page&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\page\PageSerializer.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;page&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1091,6 +1091,10 @@
</span><span class="cx">                 2D5A592F152525230036EE51 /* ImageOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8748D7412CC3F89001FBA41 /* ImageOrientation.cpp */; };
</span><span class="cx">                 2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8748D6612CC3763001FBA41 /* ImageOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D5BC42716F882EE007048D0 /* SecurityPolicyViolationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5BC42516F882BE007048D0 /* SecurityPolicyViolationEvent.h */; };
</span><ins>+                2D5C9CFF19C7B52E00B3C5C1 /* PageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5C9CFB19C7B52E00B3C5C1 /* PageOverlay.cpp */; };
+                2D5C9D0019C7B52E00B3C5C1 /* PageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5C9CFC19C7B52E00B3C5C1 /* PageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                2D5C9D0119C7B52E00B3C5C1 /* PageOverlayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5C9CFD19C7B52E00B3C5C1 /* PageOverlayController.cpp */; };
+                2D5C9D0219C7B52E00B3C5C1 /* PageOverlayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2D6E468417D660F500ECF8BB /* PDFDocumentImageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */; };
</span><span class="cx">                 2D70BA1318074DDF0001908A /* PlatformCALayerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D70BA1518074F860001908A /* PlatformCALayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D70BA1418074F850001908A /* PlatformCALayer.cpp */; };
</span><span class="lines">@@ -8083,6 +8087,10 @@
</span><span class="cx">                 2D46F04F17B96FD2005647F0 /* IntSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntSize.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D5BC42516F882BE007048D0 /* SecurityPolicyViolationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityPolicyViolationEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D5BC42616F882BE007048D0 /* SecurityPolicyViolationEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SecurityPolicyViolationEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D5C9CFB19C7B52E00B3C5C1 /* PageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageOverlay.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D5C9CFC19C7B52E00B3C5C1 /* PageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageOverlay.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D5C9CFD19C7B52E00B3C5C1 /* PageOverlayController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageOverlayController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageOverlayController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D6E468217D660F500ECF8BB /* PDFDocumentImageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PDFDocumentImageMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D70BA1218074DDF0001908A /* PlatformCALayerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformCALayerMac.h; path = ca/mac/PlatformCALayerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D70BA1418074F850001908A /* PlatformCALayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformCALayer.cpp; path = ca/PlatformCALayer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16593,6 +16601,10 @@
</span><span class="cx">                                 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */,
</span><span class="cx">                                 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */,
</span><span class="cx">                                 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */,
</span><ins>+                                2D5C9CFB19C7B52E00B3C5C1 /* PageOverlay.cpp */,
+                                2D5C9CFC19C7B52E00B3C5C1 /* PageOverlay.h */,
+                                2D5C9CFD19C7B52E00B3C5C1 /* PageOverlayController.cpp */,
+                                2D5C9CFE19C7B52E00B3C5C1 /* PageOverlayController.h */,
</ins><span class="cx">                                 371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */,
</span><span class="cx">                                 371E65CB13661EDC00BEEDB0 /* PageSerializer.h */,
</span><span class="cx">                                 A7197F2517568AE5007B9442 /* PageThrottler.cpp */,
</span><span class="lines">@@ -23656,6 +23668,7 @@
</span><span class="cx">                                 97BC6A211505F081001B74AC /* Database.h in Headers */,
</span><span class="cx">                                 97BC6A241505F081001B74AC /* DatabaseAuthorizer.h in Headers */,
</span><span class="cx">                                 FE16CFD4169D1DED00D3A0C7 /* DatabaseBackend.h in Headers */,
</span><ins>+                                2D5C9D0219C7B52E00B3C5C1 /* PageOverlayController.h in Headers */,
</ins><span class="cx">                                 97BC69DB1505F076001B74AC /* DatabaseBackendBase.h in Headers */,
</span><span class="cx">                                 FE6F6AB0169E057500FC30A2 /* DatabaseBackendContext.h in Headers */,
</span><span class="cx">                                 FE16CFD6169D1DED00D3A0C7 /* DatabaseBackendSync.h in Headers */,
</span><span class="lines">@@ -25623,6 +25636,7 @@
</span><span class="cx">                                 439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */,
</span><span class="cx">                                 439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */,
</span><span class="cx">                                 E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */,
</span><ins>+                                2D5C9D0019C7B52E00B3C5C1 /* PageOverlay.h in Headers */,
</ins><span class="cx">                                 DEBCCDD216646E8200A452E1 /* RenderMediaControlElements.h in Headers */,
</span><span class="cx">                                 41FA303F1316C29C00C0BFC5 /* RenderMediaControls.h in Headers */,
</span><span class="cx">                                 ABDDFE7A0A5C6E7000A3E11D /* RenderMenuList.h in Headers */,
</span><span class="lines">@@ -28010,6 +28024,7 @@
</span><span class="cx">                                 A5840E1C187B74D500843B10 /* InspectorInstrumentationCookie.cpp in Sources */,
</span><span class="cx">                                 71B1E1261640491A00B1880A /* InspectorLayerTreeAgent.cpp in Sources */,
</span><span class="cx">                                 504AACCD1834455900E3D9BC /* InspectorNodeFinder.cpp in Sources */,
</span><ins>+                                2D5C9D0119C7B52E00B3C5C1 /* PageOverlayController.cpp in Sources */,
</ins><span class="cx">                                 7C522D4B15B477E8009B7C95 /* InspectorOverlay.cpp in Sources */,
</span><span class="cx">                                 4F6FDD641341DEDD001F8EE3 /* InspectorPageAgent.cpp in Sources */,
</span><span class="cx">                                 99CC0B6618BE9F15006CEBCC /* InspectorReplayAgent.cpp in Sources */,
</span><span class="lines">@@ -28078,6 +28093,7 @@
</span><span class="cx">                                 BCC065870F3CE2A700CD2D87 /* JSClientRect.cpp in Sources */,
</span><span class="cx">                                 BCC065890F3CE2A700CD2D87 /* JSClientRectList.cpp in Sources */,
</span><span class="cx">                                 5C4304B5191AEF46000E2BC0 /* JSEXTShaderTextureLOD.cpp in Sources */,
</span><ins>+                                2D5C9CFF19C7B52E00B3C5C1 /* PageOverlay.cpp in Sources */,
</ins><span class="cx">                                 76FB9FF819A73E3A00420562 /* JSAutocompleteErrorEvent.cpp in Sources */,
</span><span class="cx">                                 BCA83E4F0D7CE1E9003421A8 /* JSDataTransfer.cpp in Sources */,
</span><span class="cx">                                 BCA83E520D7CE205003421A8 /* JSDataTransferCustom.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -182,6 +182,7 @@
</span><span class="cx">     virtual void scrollRectIntoView(const IntRect&amp;) const override { }
</span><span class="cx"> 
</span><span class="cx">     virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*) override { }
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(Frame*, GraphicsLayer*) override { }
</ins><span class="cx">     virtual void setNeedsOneShotDrawingSynchronization() override { }
</span><span class="cx">     virtual void scheduleCompositingLayerFlush() override { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/page/ChromeClient.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -299,6 +299,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Pass 0 as the GraphicsLayer to detatch the root layer.
</span><span class="cx">     virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*) = 0;
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(Frame*, GraphicsLayer*) = 0;
</ins><span class="cx">     // Sets a flag to specify that the next time content is drawn to the window,
</span><span class="cx">     // the changes appear on the screen in synchrony with updates to GraphicsLayers.
</span><span class="cx">     virtual void setNeedsOneShotDrawingSynchronization() = 0;
</span><span class="lines">@@ -308,8 +309,6 @@
</span><span class="cx">     // Returns whether or not the client can render the composited layer,
</span><span class="cx">     // regardless of the settings.
</span><span class="cx">     virtual bool allowsAcceleratedCompositing() const { return true; }
</span><del>-    // Supply a layer that will added as an overlay over other document layers (scrolling with the document).
-    virtual GraphicsLayer* documentOverlayLayerForFrame(Frame&amp;) { return nullptr; }
</del><span class="cx"> 
</span><span class="cx">     enum CompositingTrigger {
</span><span class="cx">         ThreeDTransformTrigger = 1 &lt;&lt; 0,
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> #include &quot;MouseEvent.h&quot;
</span><span class="cx"> #include &quot;MouseEventWithHitTestResults.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><ins>+#include &quot;PageOverlayController.h&quot;
</ins><span class="cx"> #include &quot;PlatformEvent.h&quot;
</span><span class="cx"> #include &quot;PlatformKeyboardEvent.h&quot;
</span><span class="cx"> #include &quot;PlatformWheelEvent.h&quot;
</span><span class="lines">@@ -1643,6 +1644,9 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(platformMouseEvent))
+        return true;
+
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx">     bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(platformMouseEvent);
</span><span class="cx">     if (defaultPrevented)
</span><span class="lines">@@ -1836,6 +1840,9 @@
</span><span class="cx">     RefPtr&lt;FrameView&gt; protector(m_frame.view());
</span><span class="cx">     MaximumDurationTracker maxDurationTracker(&amp;m_maxMouseMovedDuration);
</span><span class="cx"> 
</span><ins>+    if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(event))
+        return true;
+
</ins><span class="cx">     HitTestResult hoveredNode = HitTestResult(LayoutPoint());
</span><span class="cx">     bool result = handleMouseMoveEvent(event, &amp;hoveredNode);
</span><span class="cx"> 
</span><span class="lines">@@ -2019,6 +2026,9 @@
</span><span class="cx"> 
</span><span class="cx">     m_frame.selection().setCaretBlinkingSuspended(false);
</span><span class="cx"> 
</span><ins>+    if (m_frame.mainFrame().pageOverlayController().handleMouseEvent(platformMouseEvent))
+        return true;
+
</ins><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx">     bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(platformMouseEvent);
</span><span class="cx">     if (defaultPrevented)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/page/FrameView.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;MemoryPressureHandler.h&quot;
</span><span class="cx"> #include &quot;OverflowEvent.h&quot;
</span><ins>+#include &quot;PageOverlayController.h&quot;
</ins><span class="cx"> #include &quot;ProgressTracker.h&quot;
</span><span class="cx"> #include &quot;RenderEmbeddedObject.h&quot;
</span><span class="cx"> #include &quot;RenderFullScreen.h&quot;
</span><span class="lines">@@ -433,7 +434,6 @@
</span><span class="cx"> #if ENABLE(TEXT_AUTOSIZING)
</span><span class="cx">     // Autosized font sizes depend on the width of the viewing area.
</span><span class="cx">     if (newRect.width() != oldRect.width()) {
</span><del>-        Page* page = frame().page();
</del><span class="cx">         if (frame().isMainFrame() &amp;&amp; page-&gt;settings().textAutosizingEnabled()) {
</span><span class="cx">             for (Frame* frame = &amp;page-&gt;mainFrame(); frame; frame = frame-&gt;tree().traverseNext())
</span><span class="cx">                 frame().document()-&gt;textAutosizer()-&gt;recalculateMultipliers();
</span><span class="lines">@@ -449,6 +449,9 @@
</span><span class="cx">         if (renderView-&gt;usesCompositing())
</span><span class="cx">             renderView-&gt;compositor().frameViewDidChangeSize();
</span><span class="cx">     }
</span><ins>+
+    if (frame().isMainFrame())
+        frame().mainFrame().pageOverlayController().didChangeViewSize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(REQUEST_ANIMATION_FRAME)
</span><span class="lines">@@ -562,6 +565,9 @@
</span><span class="cx"> 
</span><span class="cx">     page-&gt;chrome().contentsSizeChanged(&amp;frame(), size); // Notify only.
</span><span class="cx"> 
</span><ins>+    if (frame().isMainFrame())
+        frame().mainFrame().pageOverlayController().didChangeDocumentSize();
+
</ins><span class="cx">     ASSERT(m_deferSetNeedsLayouts);
</span><span class="cx">     m_deferSetNeedsLayouts--;
</span><span class="cx">     
</span><span class="lines">@@ -2048,7 +2054,7 @@
</span><span class="cx">         // Update the scroll-bars to calculate new page-step size.
</span><span class="cx">         updateScrollbars(scrollOffset());
</span><span class="cx">     }
</span><del>-    frame().loader().client().didChangeScrollOffset();
</del><ins>+    didChangeScrollOffset();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -2061,6 +2067,12 @@
</span><span class="cx">         renderer-&gt;setNeedsLayout();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FrameView::didChangeScrollOffset()
+{
+    frame().mainFrame().pageOverlayController().didScrollFrame(frame());
+    frame().loader().client().didChangeScrollOffset();
+}
+
</ins><span class="cx"> void FrameView::scrollPositionChangedViaPlatformWidget(const IntPoint&amp; oldPosition, const IntPoint&amp; newPosition)
</span><span class="cx"> {
</span><span class="cx">     updateLayerPositionsAfterScrolling();
</span><span class="lines">@@ -3223,7 +3235,7 @@
</span><span class="cx">     ScrollView::scrollTo(newOffset);
</span><span class="cx">     if (offset != scrollOffset())
</span><span class="cx">         scrollPositionChanged(oldPosition, scrollPosition());
</span><del>-    frame().loader().client().didChangeScrollOffset();
</del><ins>+    didChangeScrollOffset();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float FrameView::adjustScrollStepForFixedContent(float step, ScrollbarOrientation orientation, ScrollGranularity granularity)
</span><span class="lines">@@ -4292,7 +4304,7 @@
</span><span class="cx">         if (offset != newOffset) {
</span><span class="cx">             ScrollView::scrollTo(newOffset);
</span><span class="cx">             scrollPositionChanged(oldPosition, scrollPosition());
</span><del>-            frame().loader().client().didChangeScrollOffset();
</del><ins>+            didChangeScrollOffset();
</ins><span class="cx">         }
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="lines">@@ -4615,6 +4627,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (auto* view = renderView())
</span><span class="cx">         view-&gt;compositor().scheduleLayerFlush(false /* canThrottle */);
</span><ins>+
+    frame().mainFrame().pageOverlayController().didChangeExposedRect();
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void FrameView::setViewportSizeForCSSViewportUnits(IntSize size)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/page/FrameView.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -511,6 +511,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual float adjustScrollStepForFixedContent(float step, ScrollbarOrientation, ScrollGranularity) override;
</span><span class="cx"> 
</span><ins>+    void didChangeScrollOffset();
+
</ins><span class="cx"> protected:
</span><span class="cx">     virtual bool scrollContentsFastPath(const IntSize&amp; scrollDelta, const IntRect&amp; rectToScroll, const IntRect&amp; clipRect) override;
</span><span class="cx">     virtual void scrollContentsSlowPath(const IntRect&amp; updateRect) override;
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/page/MainFrame.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;PageOverlayController.h&quot;
</ins><span class="cx"> #include &quot;ScrollLatchingState.h&quot;
</span><span class="cx"> #include &quot;WheelEventDeltaTracker.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -38,6 +39,7 @@
</span><span class="cx">     , m_latchingState(std::make_unique&lt;ScrollLatchingState&gt;())
</span><span class="cx"> #endif
</span><span class="cx">     , m_recentWheelEventDeltaTracker(std::make_unique&lt;WheelEventDeltaTracker&gt;())
</span><ins>+    , m_pageOverlayController(std::make_unique&lt;PageOverlayController&gt;(*this))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/page/MainFrame.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class PageOverlayController;
</ins><span class="cx"> class ScrollLatchingState;
</span><span class="cx"> class WheelEventDeltaTracker;
</span><span class="cx"> 
</span><span class="lines">@@ -43,6 +44,7 @@
</span><span class="cx">     void selfOnlyDeref();
</span><span class="cx"> 
</span><span class="cx">     WheelEventDeltaTracker* wheelEventDeltaTracker() { return m_recentWheelEventDeltaTracker.get(); }
</span><ins>+    PageOverlayController&amp; pageOverlayController() { return *m_pageOverlayController; }
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     ScrollLatchingState* latchingState() { return m_latchingState.get(); }
</span><span class="lines">@@ -60,6 +62,7 @@
</span><span class="cx">     std::unique_ptr&lt;ScrollLatchingState&gt; m_latchingState;
</span><span class="cx"> #endif
</span><span class="cx">     std::unique_ptr&lt;WheelEventDeltaTracker&gt; m_recentWheelEventDeltaTracker;
</span><ins>+    std::unique_ptr&lt;PageOverlayController&gt; m_pageOverlayController;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline bool Frame::isMainFrame() const
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/page/Page.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> #include &quot;PageConsoleClient.h&quot;
</span><span class="cx"> #include &quot;PageDebuggable.h&quot;
</span><span class="cx"> #include &quot;PageGroup.h&quot;
</span><ins>+#include &quot;PageOverlayController.h&quot;
</ins><span class="cx"> #include &quot;PageThrottler.h&quot;
</span><span class="cx"> #include &quot;PlugInClient.h&quot;
</span><span class="cx"> #include &quot;PluginData.h&quot;
</span><span class="lines">@@ -813,6 +814,8 @@
</span><span class="cx"> 
</span><span class="cx">     pageCache()-&gt;markPagesForFullStyleRecalc(this);
</span><span class="cx">     GraphicsContext::updateDocumentMarkerResources();
</span><ins>+
+    mainFrame().pageOverlayController().didChangeDeviceScaleFactor();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Page::setTopContentInset(float contentInset)
</span><span class="lines">@@ -1620,7 +1623,6 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; view : pluginViews())
</span><span class="cx">         view-&gt;privateBrowsingStateChanged(sessionID.isEphemeral());
</span><del>-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Page::PageClients::PageClients()
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageOverlaycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/PageOverlay.cpp (0 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageOverlay.cpp                                (rev 0)
+++ trunk/Source/WebCore/page/PageOverlay.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -0,0 +1,264 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PageOverlay.h&quot;
+
+#include &quot;FrameView.h&quot;
+#include &quot;GraphicsContext.h&quot;
+#include &quot;MainFrame.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;PageOverlayController.h&quot;
+#include &quot;PlatformMouseEvent.h&quot;
+#include &quot;ScrollbarTheme.h&quot;
+#include &lt;wtf/CurrentTime.h&gt;
+
+namespace WebCore {
+
+static const double fadeAnimationDuration = 0.2;
+static const double fadeAnimationFrameRate = 30;
+
+PassRefPtr&lt;PageOverlay&gt; PageOverlay::create(Client&amp; client, OverlayType overlayType)
+{
+    return adoptRef(new PageOverlay(client, overlayType));
+}
+
+PageOverlay::PageOverlay(Client&amp; client, OverlayType overlayType)
+    : m_client(client)
+    , m_page(nullptr)
+    , m_fadeAnimationTimer(this, &amp;PageOverlay::fadeAnimationTimerFired)
+    , m_fadeAnimationStartTime(0)
+    , m_fadeAnimationDuration(fadeAnimationDuration)
+    , m_fadeAnimationType(NoAnimation)
+    , m_fractionFadedIn(1)
+    , m_overlayType(overlayType)
+    , m_backgroundColor(Color::transparent)
+{
+}
+
+PageOverlay::~PageOverlay()
+{
+}
+
+PageOverlayController* PageOverlay::controller() const
+{
+    if (!m_page)
+        return nullptr;
+    return &amp;m_page-&gt;mainFrame().pageOverlayController();
+}
+
+IntRect PageOverlay::bounds() const
+{
+    if (!m_overrideFrame.isEmpty())
+        return IntRect(IntPoint(), m_overrideFrame.size());
+
+    FrameView* frameView = m_page-&gt;mainFrame().view();
+
+    if (!frameView)
+        return IntRect();
+
+    switch (m_overlayType) {
+    case OverlayType::View: {
+        int width = frameView-&gt;width();
+        int height = frameView-&gt;height();
+
+        if (!ScrollbarTheme::theme()-&gt;usesOverlayScrollbars()) {
+            if (frameView-&gt;verticalScrollbar())
+                width -= frameView-&gt;verticalScrollbar()-&gt;width();
+            if (frameView-&gt;horizontalScrollbar())
+                height -= frameView-&gt;horizontalScrollbar()-&gt;height();
+        }
+        return IntRect(0, 0, width, height);
+    }
+    case OverlayType::Document:
+        return IntRect(IntPoint(), frameView-&gt;contentsSize());
+    };
+
+    ASSERT_NOT_REACHED();
+    return IntRect(IntPoint(), frameView-&gt;contentsSize());
+}
+
+IntRect PageOverlay::frame() const
+{
+    if (!m_overrideFrame.isEmpty())
+        return m_overrideFrame;
+
+    return bounds();
+}
+
+void PageOverlay::setFrame(IntRect frame)
+{
+    if (m_overrideFrame == frame)
+        return;
+
+    m_overrideFrame = frame;
+
+    if (auto pageOverlayController = controller())
+        pageOverlayController-&gt;didChangeOverlayFrame(*this);
+}
+
+void PageOverlay::setBackgroundColor(RGBA32 backgroundColor)
+{
+    if (m_backgroundColor == backgroundColor)
+        return;
+
+    m_backgroundColor = backgroundColor;
+
+    if (auto pageOverlayController = controller())
+        pageOverlayController-&gt;didChangeOverlayBackgroundColor(*this);
+}
+
+void PageOverlay::setPage(Page* page)
+{
+    m_client.willMoveToPage(*this, page);
+    m_page = page;
+    m_client.didMoveToPage(*this, page);
+
+    m_fadeAnimationTimer.stop();
+}
+
+void PageOverlay::setNeedsDisplay(const IntRect&amp; dirtyRect)
+{
+    if (auto pageOverlayController = controller()) {
+        pageOverlayController-&gt;setPageOverlayOpacity(*this, m_fractionFadedIn);
+        pageOverlayController-&gt;setPageOverlayNeedsDisplay(*this, dirtyRect);
+    }
+}
+
+void PageOverlay::setNeedsDisplay()
+{
+    setNeedsDisplay(bounds());
+}
+
+void PageOverlay::drawRect(GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect)
+{
+    // If the dirty rect is outside the bounds, ignore it.
+    IntRect paintRect = intersection(dirtyRect, bounds());
+    if (paintRect.isEmpty())
+        return;
+
+    GraphicsContextStateSaver stateSaver(graphicsContext);
+    m_client.drawRect(*this, graphicsContext, paintRect);
+}
+    
+bool PageOverlay::mouseEvent(const PlatformMouseEvent&amp; mouseEvent)
+{
+    IntPoint mousePositionInOverlayCoordinates(mouseEvent.position());
+
+    if (m_overlayType == PageOverlay::OverlayType::Document)
+        mousePositionInOverlayCoordinates = m_page-&gt;mainFrame().view()-&gt;rootViewToContents(mousePositionInOverlayCoordinates);
+
+    // Ignore events outside the bounds.
+    if (!bounds().contains(mousePositionInOverlayCoordinates))
+        return false;
+
+    return m_client.mouseEvent(*this, mouseEvent);
+}
+
+void PageOverlay::didScrollFrame(Frame&amp; frame)
+{
+    m_client.didScrollFrame(*this, frame);
+}
+
+bool PageOverlay::copyAccessibilityAttributeStringValueForPoint(String attribute, FloatPoint parameter, String&amp; value)
+{
+    return m_client.copyAccessibilityAttributeStringValueForPoint(*this, attribute, parameter, value);
+}
+
+bool PageOverlay::copyAccessibilityAttributeBoolValueForPoint(String attribute, FloatPoint parameter, bool&amp; value)
+{
+    return m_client.copyAccessibilityAttributeBoolValueForPoint(*this, attribute, parameter, value);
+}
+
+Vector&lt;String&gt; PageOverlay::copyAccessibilityAttributeNames(bool parameterizedNames)
+{
+    return m_client.copyAccessibilityAttributeNames(*this, parameterizedNames);
+}
+
+void PageOverlay::startFadeInAnimation()
+{
+    m_fractionFadedIn = 0;
+    m_fadeAnimationType = FadeInAnimation;
+
+    startFadeAnimation();
+}
+
+void PageOverlay::startFadeOutAnimation()
+{
+    m_fractionFadedIn = 1;
+    m_fadeAnimationType = FadeOutAnimation;
+
+    startFadeAnimation();
+}
+
+void PageOverlay::stopFadeOutAnimation()
+{
+    m_fractionFadedIn = 1.0;
+    m_fadeAnimationTimer.stop();
+}
+
+void PageOverlay::startFadeAnimation()
+{
+    m_fadeAnimationStartTime = currentTime();
+    m_fadeAnimationTimer.startRepeating(1 / fadeAnimationFrameRate);
+}
+
+void PageOverlay::fadeAnimationTimerFired(Timer&lt;PageOverlay&gt;&amp;)
+{
+    float animationProgress = (currentTime() - m_fadeAnimationStartTime) / m_fadeAnimationDuration;
+
+    if (animationProgress &gt;= 1.0)
+        animationProgress = 1.0;
+
+    double sine = sin(piOverTwoFloat * animationProgress);
+    float fadeAnimationValue = sine * sine;
+
+    m_fractionFadedIn = (m_fadeAnimationType == FadeInAnimation) ? fadeAnimationValue : 1 - fadeAnimationValue;
+    controller()-&gt;setPageOverlayOpacity(*this, m_fractionFadedIn);
+
+    if (animationProgress == 1.0) {
+        m_fadeAnimationTimer.stop();
+
+        bool wasFadingOut = m_fadeAnimationType == FadeOutAnimation;
+        m_fadeAnimationType = NoAnimation;
+
+        // If this was a fade out, go ahead and uninstall the page overlay.
+        if (wasFadingOut)
+            controller()-&gt;uninstallPageOverlay(this, PageOverlay::FadeMode::DoNotFade);
+    }
+}
+
+void PageOverlay::clear()
+{
+    if (auto pageOverlayController = controller())
+        pageOverlayController-&gt;clearPageOverlay(*this);
+}
+
+GraphicsLayer&amp; PageOverlay::layer()
+{
+    return controller()-&gt;layerForOverlay(*this);
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebCorepagePageOverlayh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/PageOverlay.h (0 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageOverlay.h                                (rev 0)
+++ trunk/Source/WebCore/page/PageOverlay.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PageOverlay_h
+#define PageOverlay_h
+
+#include &quot;Color.h&quot;
+#include &quot;FloatPoint.h&quot;
+#include &quot;IntRect.h&quot;
+#include &quot;Timer.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class Frame;
+class GraphicsContext;
+class GraphicsLayer;
+class Page;
+class PageOverlayController;
+class PlatformMouseEvent;
+
+class PageOverlay final : public RefCounted&lt;PageOverlay&gt; {
+    WTF_MAKE_NONCOPYABLE(PageOverlay);
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    class Client {
+    protected:
+        virtual ~Client() { }
+    
+    public:
+        virtual void pageOverlayDestroyed(PageOverlay&amp;) = 0;
+        virtual void willMoveToPage(PageOverlay&amp;, Page*) = 0;
+        virtual void didMoveToPage(PageOverlay&amp;, Page*) = 0;
+        virtual void drawRect(PageOverlay&amp;, GraphicsContext&amp;, const IntRect&amp; dirtyRect) = 0;
+        virtual bool mouseEvent(PageOverlay&amp;, const PlatformMouseEvent&amp;) = 0;
+        virtual void didScrollFrame(PageOverlay&amp;, Frame&amp;) { }
+
+        virtual bool copyAccessibilityAttributeStringValueForPoint(PageOverlay&amp;, String /* attribute */, FloatPoint, String&amp;) { return false; }
+        virtual bool copyAccessibilityAttributeBoolValueForPoint(PageOverlay&amp;, String /* attribute */, FloatPoint, bool&amp;)  { return false; }
+        virtual Vector&lt;String&gt; copyAccessibilityAttributeNames(PageOverlay&amp;, bool /* parameterizedNames */)  { return { }; }
+    };
+
+    enum class OverlayType {
+        View, // Fixed to the view size; does not scale or scroll with the document, repaints on scroll.
+        Document, // Scales and scrolls with the document.
+    };
+
+    static PassRefPtr&lt;PageOverlay&gt; create(Client&amp;, OverlayType = OverlayType::View);
+    virtual ~PageOverlay();
+
+    PageOverlayController* controller() const;
+
+    void setPage(Page*);
+    void setNeedsDisplay(const IntRect&amp; dirtyRect);
+    void setNeedsDisplay();
+
+    void drawRect(GraphicsContext&amp;, const IntRect&amp; dirtyRect);
+    bool mouseEvent(const PlatformMouseEvent&amp;);
+    void didScrollFrame(Frame&amp;);
+
+    bool copyAccessibilityAttributeStringValueForPoint(String attribute, FloatPoint parameter, String&amp; value);
+    bool copyAccessibilityAttributeBoolValueForPoint(String attribute, FloatPoint parameter, bool&amp; value);
+    Vector&lt;String&gt; copyAccessibilityAttributeNames(bool parameterizedNames);
+    
+    void startFadeInAnimation();
+    void startFadeOutAnimation();
+    void stopFadeOutAnimation();
+
+    void clear();
+
+    Client&amp; client() const { return m_client; }
+
+    enum class FadeMode { DoNotFade, Fade };
+
+    OverlayType overlayType() { return m_overlayType; }
+
+    IntRect bounds() const;
+    IntRect frame() const;
+    void setFrame(IntRect);
+
+    RGBA32 backgroundColor() const { return m_backgroundColor; }
+    void setBackgroundColor(RGBA32);
+
+    // FIXME: PageOverlay should own its layer, instead of PageOverlayController.
+    GraphicsLayer&amp; layer();
+
+private:
+    explicit PageOverlay(Client&amp;, OverlayType);
+
+    void startFadeAnimation();
+    void fadeAnimationTimerFired(Timer&lt;PageOverlay&gt;&amp;);
+
+    Client&amp; m_client;
+    Page* m_page;
+
+    Timer&lt;PageOverlay&gt; m_fadeAnimationTimer;
+    double m_fadeAnimationStartTime;
+    double m_fadeAnimationDuration;
+
+    enum FadeAnimationType {
+        NoAnimation,
+        FadeInAnimation,
+        FadeOutAnimation,
+    };
+
+    FadeAnimationType m_fadeAnimationType;
+    float m_fractionFadedIn;
+
+    OverlayType m_overlayType;
+    IntRect m_overrideFrame;
+
+    RGBA32 m_backgroundColor;
+};
+
+} // namespace WebKit
+
+#endif // PageOverlay_h
</ins></span></pre></div>
<a id="trunkSourceWebCorepagePageOverlayControllercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/PageOverlayController.cpp (0 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageOverlayController.cpp                                (rev 0)
+++ trunk/Source/WebCore/page/PageOverlayController.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -0,0 +1,361 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;PageOverlayController.h&quot;
+
+#include &quot;Chrome.h&quot;
+#include &quot;ChromeClient.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;FrameView.h&quot;
+#include &quot;GraphicsContext.h&quot;
+#include &quot;GraphicsLayer.h&quot;
+#include &quot;MainFrame.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;PageOverlay.h&quot;
+#include &quot;ScrollingCoordinator.h&quot;
+#include &quot;Settings.h&quot;
+#include &quot;TiledBacking.h&quot;
+
+// FIXME: Someone needs to call didChangeSettings() if we want dynamic updates of layer border/repaint counter settings.
+
+namespace WebCore {
+
+PageOverlayController::PageOverlayController(MainFrame&amp; mainFrame)
+    : m_initialized(false)
+    , m_mainFrame(mainFrame)
+{
+}
+
+PageOverlayController::~PageOverlayController()
+{
+
+}
+
+void PageOverlayController::createRootLayersIfNeeded()
+{
+    if (m_initialized)
+        return;
+
+    m_initialized = true;
+
+    ASSERT(!m_documentOverlayRootLayer);
+    ASSERT(!m_viewOverlayRootLayer);
+
+    m_documentOverlayRootLayer = GraphicsLayer::create(m_mainFrame.page()-&gt;chrome().client().graphicsLayerFactory(), *this);
+    m_viewOverlayRootLayer = GraphicsLayer::create(m_mainFrame.page()-&gt;chrome().client().graphicsLayerFactory(), *this);
+#ifndef NDEBUG
+    m_documentOverlayRootLayer-&gt;setName(&quot;Page Overlay container (document-relative)&quot;);
+    m_viewOverlayRootLayer-&gt;setName(&quot;Page Overlay container (view-relative)&quot;);
+#endif
+}
+
+GraphicsLayer&amp; PageOverlayController::documentOverlayRootLayer()
+{
+    createRootLayersIfNeeded();
+    return *m_documentOverlayRootLayer;
+}
+
+GraphicsLayer&amp; PageOverlayController::viewOverlayRootLayer()
+{
+    createRootLayersIfNeeded();
+    return *m_viewOverlayRootLayer;
+}
+
+static void updateOverlayGeometry(PageOverlay&amp; overlay, GraphicsLayer&amp; graphicsLayer)
+{
+    IntRect overlayFrame = overlay.frame();
+
+    if (overlayFrame.location() == graphicsLayer.position() &amp;&amp; overlayFrame.size() == graphicsLayer.size())
+        return;
+
+    graphicsLayer.setPosition(overlayFrame.location());
+    graphicsLayer.setSize(overlayFrame.size());
+}
+
+void PageOverlayController::installPageOverlay(PassRefPtr&lt;PageOverlay&gt; pageOverlay, PageOverlay::FadeMode fadeMode)
+{
+    createRootLayersIfNeeded();
+
+    RefPtr&lt;PageOverlay&gt; overlay = pageOverlay;
+
+    if (m_pageOverlays.contains(overlay))
+        return;
+
+    m_pageOverlays.append(overlay);
+
+    std::unique_ptr&lt;GraphicsLayer&gt; layer = GraphicsLayer::create(m_mainFrame.page()-&gt;chrome().client().graphicsLayerFactory(), *this);
+    layer-&gt;setAnchorPoint(FloatPoint3D());
+    layer-&gt;setBackgroundColor(overlay-&gt;backgroundColor());
+#ifndef NDEBUG
+    layer-&gt;setName(&quot;Page Overlay content&quot;);
+#endif
+
+    updateSettingsForLayer(*layer);
+
+    switch (overlay-&gt;overlayType()) {
+    case PageOverlay::OverlayType::View:
+        m_viewOverlayRootLayer-&gt;addChild(layer.get());
+        break;
+    case PageOverlay::OverlayType::Document:
+        m_documentOverlayRootLayer-&gt;addChild(layer.get());
+        break;
+    }
+
+    GraphicsLayer&amp; rawLayer = *layer;
+    m_overlayGraphicsLayers.set(overlay.get(), WTF::move(layer));
+
+    updateForceSynchronousScrollLayerPositionUpdates();
+
+    overlay-&gt;setPage(m_mainFrame.page());
+
+    if (FrameView* frameView = m_mainFrame.view())
+        frameView-&gt;enterCompositingMode();
+
+    updateOverlayGeometry(*overlay, rawLayer);
+
+    if (fadeMode == PageOverlay::FadeMode::Fade)
+        overlay-&gt;startFadeInAnimation();
+}
+
+void PageOverlayController::uninstallPageOverlay(PageOverlay* overlay, PageOverlay::FadeMode fadeMode)
+{
+    if (fadeMode == PageOverlay::FadeMode::Fade) {
+        overlay-&gt;startFadeOutAnimation();
+        return;
+    }
+
+    overlay-&gt;setPage(nullptr);
+
+    m_overlayGraphicsLayers.take(overlay)-&gt;removeFromParent();
+
+    size_t overlayIndex = m_pageOverlays.find(overlay);
+    ASSERT(overlayIndex != notFound);
+    m_pageOverlays.remove(overlayIndex);
+
+    updateForceSynchronousScrollLayerPositionUpdates();
+}
+
+void PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates()
+{
+#if ENABLE(ASYNC_SCROLLING)
+    bool forceSynchronousScrollLayerPositionUpdates = false;
+
+    for (auto&amp; overlay : m_pageOverlays) {
+        if (overlay-&gt;overlayType() == PageOverlay::OverlayType::View)
+            forceSynchronousScrollLayerPositionUpdates = true;
+    }
+
+    if (ScrollingCoordinator* scrollingCoordinator = m_mainFrame.page()-&gt;scrollingCoordinator())
+        scrollingCoordinator-&gt;setForceSynchronousScrollLayerPositionUpdates(forceSynchronousScrollLayerPositionUpdates);
+#endif
+}
+
+void PageOverlayController::setPageOverlayNeedsDisplay(PageOverlay&amp; overlay, const WebCore::IntRect&amp; dirtyRect)
+{
+    ASSERT(m_pageOverlays.contains(&amp;overlay));
+    GraphicsLayer&amp; graphicsLayer = *m_overlayGraphicsLayers.get(&amp;overlay);
+
+    if (!graphicsLayer.drawsContent()) {
+        graphicsLayer.setDrawsContent(true);
+        updateOverlayGeometry(overlay, graphicsLayer);
+    }
+
+    graphicsLayer.setNeedsDisplayInRect(dirtyRect);
+}
+
+void PageOverlayController::setPageOverlayOpacity(PageOverlay&amp; overlay, float opacity)
+{
+    ASSERT(m_pageOverlays.contains(&amp;overlay));
+    m_overlayGraphicsLayers.get(&amp;overlay)-&gt;setOpacity(opacity);
+}
+
+void PageOverlayController::clearPageOverlay(PageOverlay&amp; overlay)
+{
+    ASSERT(m_pageOverlays.contains(&amp;overlay));
+    m_overlayGraphicsLayers.get(&amp;overlay)-&gt;setDrawsContent(false);
+}
+
+GraphicsLayer&amp; PageOverlayController::layerForOverlay(PageOverlay&amp; overlay) const
+{
+    ASSERT(m_pageOverlays.contains(&amp;overlay));
+    return *m_overlayGraphicsLayers.get(&amp;overlay);
+}
+
+void PageOverlayController::willAttachRootLayer()
+{
+    for (auto&amp; overlayAndLayer : m_overlayGraphicsLayers)
+        updateOverlayGeometry(*overlayAndLayer.key, *overlayAndLayer.value);
+}
+
+void PageOverlayController::didChangeViewSize()
+{
+    for (auto&amp; overlayAndLayer : m_overlayGraphicsLayers) {
+        if (overlayAndLayer.key-&gt;overlayType() == PageOverlay::OverlayType::View)
+            updateOverlayGeometry(*overlayAndLayer.key, *overlayAndLayer.value);
+    }
+}
+
+void PageOverlayController::didChangeDocumentSize()
+{
+    for (auto&amp; overlayAndLayer : m_overlayGraphicsLayers) {
+        if (overlayAndLayer.key-&gt;overlayType() == PageOverlay::OverlayType::Document)
+            updateOverlayGeometry(*overlayAndLayer.key, *overlayAndLayer.value);
+    }
+}
+
+void PageOverlayController::didChangeSettings()
+{
+    // FIXME: We should apply these settings to all overlay sublayers recursively.
+    for (auto&amp; graphicsLayer : m_overlayGraphicsLayers.values())
+        updateSettingsForLayer(*graphicsLayer);
+}
+
+void PageOverlayController::didChangeDeviceScaleFactor()
+{
+    createRootLayersIfNeeded();
+
+    m_documentOverlayRootLayer-&gt;noteDeviceOrPageScaleFactorChangedIncludingDescendants();
+    m_viewOverlayRootLayer-&gt;noteDeviceOrPageScaleFactorChangedIncludingDescendants();
+
+    for (auto&amp; graphicsLayer : m_overlayGraphicsLayers.values())
+        graphicsLayer-&gt;setNeedsDisplay();
+}
+
+void PageOverlayController::didChangeExposedRect()
+{
+    m_mainFrame.page()-&gt;chrome().client().scheduleCompositingLayerFlush();
+}
+
+void PageOverlayController::didScrollFrame(Frame&amp; frame)
+{
+    for (auto&amp; overlayAndLayer : m_overlayGraphicsLayers) {
+        if (overlayAndLayer.key-&gt;overlayType() == PageOverlay::OverlayType::View || !frame.isMainFrame())
+            overlayAndLayer.value-&gt;setNeedsDisplay();
+        overlayAndLayer.key-&gt;didScrollFrame(frame);
+    }
+}
+
+void PageOverlayController::updateSettingsForLayer(GraphicsLayer&amp; layer)
+{
+    Settings&amp; settings = m_mainFrame.page()-&gt;settings();
+    layer.setAcceleratesDrawing(settings.acceleratedDrawingEnabled());
+    layer.setShowDebugBorder(settings.showDebugBorders());
+    layer.setShowRepaintCounter(settings.showRepaintCounter());
+}
+
+bool PageOverlayController::handleMouseEvent(const PlatformMouseEvent&amp; mouseEvent)
+{
+    if (m_pageOverlays.isEmpty())
+        return false;
+
+    for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
+        if ((*it)-&gt;mouseEvent(mouseEvent))
+            return true;
+    }
+
+    return false;
+}
+
+bool PageOverlayController::copyAccessibilityAttributeStringValueForPoint(String attribute, FloatPoint parameter, String&amp; value)
+{
+    if (m_pageOverlays.isEmpty())
+        return false;
+
+    for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
+        if ((*it)-&gt;copyAccessibilityAttributeStringValueForPoint(attribute, parameter, value))
+            return true;
+    }
+
+    return false;
+}
+
+bool PageOverlayController::copyAccessibilityAttributeBoolValueForPoint(String attribute, FloatPoint parameter, bool&amp; value)
+{
+    if (m_pageOverlays.isEmpty())
+        return false;
+
+    for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
+        if ((*it)-&gt;copyAccessibilityAttributeBoolValueForPoint(attribute, parameter, value))
+            return true;
+    }
+    
+    return false;
+}
+
+Vector&lt;String&gt; PageOverlayController::copyAccessibilityAttributesNames(bool parameterizedNames)
+{
+    if (m_pageOverlays.isEmpty())
+        return { };
+
+    for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
+        Vector&lt;String&gt; names = (*it)-&gt;copyAccessibilityAttributeNames(parameterizedNames);
+        if (!names.isEmpty())
+            return names;
+    }
+
+    return { };
+}
+
+void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext&amp; graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect&amp; clipRect)
+{
+    for (auto&amp; overlayAndGraphicsLayer : m_overlayGraphicsLayers) {
+        if (overlayAndGraphicsLayer.value.get() != graphicsLayer)
+            continue;
+
+        GraphicsContextStateSaver stateSaver(graphicsContext);
+        graphicsContext.clip(clipRect);
+        overlayAndGraphicsLayer.key-&gt;drawRect(graphicsContext, enclosingIntRect(clipRect));
+
+        return;
+    }
+}
+
+float PageOverlayController::deviceScaleFactor() const
+{
+    if (Page* page = m_mainFrame.page())
+        return page-&gt;deviceScaleFactor();
+    return 1;
+}
+
+void PageOverlayController::notifyFlushRequired(const WebCore::GraphicsLayer*)
+{
+    if (Page* page = m_mainFrame.page())
+        page-&gt;chrome().client().scheduleCompositingLayerFlush();
+}
+
+void PageOverlayController::didChangeOverlayFrame(PageOverlay&amp; overlay)
+{
+    ASSERT(m_pageOverlays.contains(&amp;overlay));
+    updateOverlayGeometry(overlay, *m_overlayGraphicsLayers.get(&amp;overlay));
+}
+
+void PageOverlayController::didChangeOverlayBackgroundColor(PageOverlay&amp; overlay)
+{
+    ASSERT(m_pageOverlays.contains(&amp;overlay));
+    m_overlayGraphicsLayers.get(&amp;overlay)-&gt;setBackgroundColor(overlay.backgroundColor());
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebCorepagePageOverlayControllerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/page/PageOverlayController.h (0 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageOverlayController.h                                (rev 0)
+++ trunk/Source/WebCore/page/PageOverlayController.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PageOverlayController_h
+#define PageOverlayController_h
+
+#include &quot;GraphicsLayerClient.h&quot;
+#include &quot;PageOverlay.h&quot;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+
+class Frame;
+class MainFrame;
+class Page;
+class PlatformMouseEvent;
+
+class PageOverlayController final : public GraphicsLayerClient {
+    WTF_MAKE_NONCOPYABLE(PageOverlayController);
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    PageOverlayController(MainFrame&amp;);
+    virtual ~PageOverlayController();
+
+    GraphicsLayer&amp; documentOverlayRootLayer();
+    GraphicsLayer&amp; viewOverlayRootLayer();
+
+    void installPageOverlay(PassRefPtr&lt;PageOverlay&gt;, PageOverlay::FadeMode);
+    void uninstallPageOverlay(PageOverlay*, PageOverlay::FadeMode);
+
+    void setPageOverlayNeedsDisplay(PageOverlay&amp;, const IntRect&amp;);
+    void setPageOverlayOpacity(PageOverlay&amp;, float);
+    void clearPageOverlay(PageOverlay&amp;);
+    GraphicsLayer&amp; layerForOverlay(PageOverlay&amp;) const;
+
+    void willAttachRootLayer();
+
+    void didChangeViewSize();
+    void didChangeDocumentSize();
+    void didChangeSettings();
+    void didChangeDeviceScaleFactor();
+    void didChangeExposedRect();
+    void didScrollFrame(Frame&amp;);
+
+    void didChangeOverlayFrame(PageOverlay&amp;);
+    void didChangeOverlayBackgroundColor(PageOverlay&amp;);
+
+    int overlayCount() const { return m_overlayGraphicsLayers.size(); }
+
+    bool handleMouseEvent(const PlatformMouseEvent&amp;);
+
+    bool copyAccessibilityAttributeStringValueForPoint(String attribute, FloatPoint, String&amp; value);
+    bool copyAccessibilityAttributeBoolValueForPoint(String attribute, FloatPoint, bool&amp; value);
+    Vector&lt;String&gt; copyAccessibilityAttributesNames(bool parameterizedNames);
+
+private:
+    void createRootLayersIfNeeded();
+
+    void updateSettingsForLayer(GraphicsLayer&amp;);
+    void updateForceSynchronousScrollLayerPositionUpdates();
+
+    // GraphicsLayerClient
+    virtual void notifyFlushRequired(const GraphicsLayer*) override;
+    virtual void paintContents(const GraphicsLayer*, GraphicsContext&amp;, GraphicsLayerPaintingPhase, const FloatRect&amp; clipRect) override;
+    virtual float deviceScaleFactor() const override;
+    virtual bool shouldSkipLayerInDump(const GraphicsLayer*) const override { return true; }
+
+    std::unique_ptr&lt;GraphicsLayer&gt; m_documentOverlayRootLayer;
+    std::unique_ptr&lt;GraphicsLayer&gt; m_viewOverlayRootLayer;
+    bool m_initialized;
+
+    HashMap&lt;PageOverlay*, std::unique_ptr&lt;GraphicsLayer&gt;&gt; m_overlayGraphicsLayers;
+    Vector&lt;RefPtr&lt;PageOverlay&gt;&gt; m_pageOverlays;
+    MainFrame&amp; m_mainFrame;
+};
+
+} // namespace WebKit
+
+#endif // PageOverlayController_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> #ifndef GraphicsLayerClient_h
</span><span class="cx"> #define GraphicsLayerClient_h
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/Forward.h&gt;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class FloatPoint;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -2322,7 +2322,7 @@
</span><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::didScrollLayer(&amp;frame);
</span><span class="cx">     if (scrollsOverflow())
</span><del>-        frame.loader().client().didChangeScrollOffset();
</del><ins>+        view.frameView().didChangeScrollOffset();
</ins><span class="cx"> 
</span><span class="cx">     view.frameView().resumeVisibleImageAnimationsIncludingSubframes();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;NodeList.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><ins>+#include &quot;PageOverlayController.h&quot;
</ins><span class="cx"> #include &quot;RenderEmbeddedObject.h&quot;
</span><span class="cx"> #include &quot;RenderFlowThread.h&quot;
</span><span class="cx"> #include &quot;RenderFullScreen.h&quot;
</span><span class="lines">@@ -643,7 +644,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer&amp; rootLayer) const
</span><span class="cx"> {
</span><del>-    return m_compositedLayerCount &gt; (rootLayer.isComposited() ? 1 : 0);
</del><ins>+    int layerCount = m_compositedLayerCount + m_renderView.frame().mainFrame().pageOverlayController().overlayCount();
+    return layerCount &gt; (rootLayer.isComposited() ? 1 : 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderLayerCompositor::cancelCompositingLayerUpdate()
</span><span class="lines">@@ -665,7 +667,7 @@
</span><span class="cx">     if (m_renderView.needsLayout())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (m_forceCompositingMode &amp;&amp; !m_compositing)
</del><ins>+    if ((m_forceCompositingMode || m_renderView.frame().mainFrame().pageOverlayController().overlayCount()) &amp;&amp; !m_compositing)
</ins><span class="cx">         enableCompositingMode(true);
</span><span class="cx"> 
</span><span class="cx">     if (!m_reevaluateCompositingAfterLayout &amp;&amp; !m_compositing)
</span><span class="lines">@@ -748,7 +750,7 @@
</span><span class="cx"> 
</span><span class="cx">         // Host the document layer in the RenderView's root layer.
</span><span class="cx">         if (isFullUpdate) {
</span><del>-            appendOverlayLayers(childList);
</del><ins>+            appendDocumentOverlayLayers(childList);
</ins><span class="cx">             // Even when childList is empty, don't drop out of compositing mode if there are
</span><span class="cx">             // composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
</span><span class="cx">             if (childList.isEmpty() &amp;&amp; !hasAnyAdditionalCompositedLayers(*updateRoot))
</span><span class="lines">@@ -784,15 +786,19 @@
</span><span class="cx">     InspectorInstrumentation::layerTreeDidChange(page());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderLayerCompositor::appendOverlayLayers(Vector&lt;GraphicsLayer*&gt;&amp; childList)
</del><ins>+void RenderLayerCompositor::appendDocumentOverlayLayers(Vector&lt;GraphicsLayer*&gt;&amp; childList)
</ins><span class="cx"> {
</span><span class="cx">     Frame&amp; frame = m_renderView.frameView().frame();
</span><ins>+    if (!frame.isMainFrame())
+        return;
+
</ins><span class="cx">     Page* page = frame.page();
</span><span class="cx">     if (!page)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (GraphicsLayer* overlayLayer = page-&gt;chrome().client().documentOverlayLayerForFrame(frame))
-        childList.append(overlayLayer);
</del><ins>+    PageOverlayController&amp; pageOverlayController = frame.mainFrame().pageOverlayController();
+    pageOverlayController.willAttachRootLayer();
+    childList.append(&amp;pageOverlayController.documentOverlayRootLayer());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderLayerCompositor::layerBecameNonComposited(const RenderLayer&amp; layer)
</span><span class="lines">@@ -3366,6 +3372,11 @@
</span><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">             page-&gt;chrome().client().attachRootGraphicsLayer(&amp;frame, rootGraphicsLayer());
</span><ins>+            if (frame.isMainFrame()) {
+                PageOverlayController&amp; pageOverlayController = frame.mainFrame().pageOverlayController();
+                pageOverlayController.willAttachRootLayer();
+                page-&gt;chrome().client().attachViewOverlayGraphicsLayer(&amp;frame, &amp;pageOverlayController.viewOverlayRootLayer());
+            }
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         case RootLayerAttachedViaEnclosingFrame: {
</span><span class="lines">@@ -3410,6 +3421,8 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         page-&gt;chrome().client().attachRootGraphicsLayer(&amp;frame, 0);
</span><ins>+        if (frame.isMainFrame())
+            page-&gt;chrome().client().attachViewOverlayGraphicsLayer(&amp;frame, 0);
</ins><span class="cx">     }
</span><span class="cx">     break;
</span><span class="cx">     case RootLayerUnattached:
</span><span class="lines">@@ -3444,8 +3457,12 @@
</span><span class="cx">     if (RenderLayerBacking* backing = layer ? layer-&gt;backing() : nullptr)
</span><span class="cx">         backing-&gt;updateDrawsContent();
</span><span class="cx"> 
</span><del>-    if (GraphicsLayer* overlayLayer = page-&gt;chrome().client().documentOverlayLayerForFrame(frame))
-        m_rootContentLayer-&gt;addChild(overlayLayer);
</del><ins>+    if (!frame.isMainFrame())
+        return;
+
+    PageOverlayController&amp; pageOverlayController = frame.mainFrame().pageOverlayController();
+    pageOverlayController.willAttachRootLayer();
+    m_rootContentLayer-&gt;addChild(&amp;pageOverlayController.documentOverlayRootLayer());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // IFrames are special, because we hook compositing layers together across iframe boundaries
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -362,7 +362,7 @@
</span><span class="cx">     bool layerHas3DContent(const RenderLayer&amp;) const;
</span><span class="cx">     bool isRunningAcceleratedTransformAnimation(RenderLayerModelObject&amp;) const;
</span><span class="cx"> 
</span><del>-    void appendOverlayLayers(Vector&lt;GraphicsLayer*&gt;&amp;);
</del><ins>+    void appendDocumentOverlayLayers(Vector&lt;GraphicsLayer*&gt;&amp;);
</ins><span class="cx">     bool hasAnyAdditionalCompositedLayers(const RenderLayer&amp; rootLayer) const;
</span><span class="cx"> 
</span><span class="cx">     void ensureRootLayer();
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-10-02  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Move PageOverlay[Controller] to WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=137164
+        &lt;rdar://problem/18508258&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::attachViewOverlayGraphicsLayer):
+        Add an empty ChromeClient override.
+
</ins><span class="cx"> 2014-10-01  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Have is&lt;&gt;(T*) function do a null check on the pointer argument
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -163,6 +163,7 @@
</span><span class="cx">     virtual bool shouldPaintEntireContents() const override;
</span><span class="cx"> 
</span><span class="cx">     virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
</ins><span class="cx">     virtual void setNeedsOneShotDrawingSynchronization() override;
</span><span class="cx">     virtual void scheduleCompositingLayerFlush() override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -922,6 +922,11 @@
</span><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebChromeClient::attachViewOverlayGraphicsLayer(Frame*, GraphicsLayer*)
+{
+    // FIXME: If we want view-relative page overlays in Legacy WebKit, this would be the place to hook them up.
+}
+
</ins><span class="cx"> void WebChromeClient::setNeedsOneShotDrawingSynchronization()
</span><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS;
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit/win/ChangeLog        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-10-02  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Move PageOverlay[Controller] to WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=137164
+        &lt;rdar://problem/18508258&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::attachViewOverlayGraphicsLayer):
+        * WebCoreSupport/WebChromeClient.h:
+        Add an empty ChromeClient override.
+
</ins><span class="cx"> 2014-10-01  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Have is&lt;&gt;(T*) function do a null check on the pointer argument
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -752,6 +752,11 @@
</span><span class="cx">     m_webView-&gt;setRootChildLayer(graphicsLayer);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebChromeClient::attachViewOverlayGraphicsLayer(Frame*, GraphicsLayer*)
+{
+    // FIXME: If we want view-relative page overlays in Legacy WebKit on Windows, this would be the place to hook them up.
+}
+
</ins><span class="cx"> void WebChromeClient::scheduleCompositingLayerFlush()
</span><span class="cx"> {
</span><span class="cx">     m_webView-&gt;flushPendingGraphicsLayerChangesSoon();
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebChromeClient.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -130,6 +130,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Pass 0 as the GraphicsLayer to detatch the root layer.
</span><span class="cx">     virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*);
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
</ins><span class="cx">     // Sets a flag to specify that the next time content is drawn to the window,
</span><span class="cx">     // the changes appear on the screen in synchrony with updates to GraphicsLayers.
</span><span class="cx">     virtual void setNeedsOneShotDrawingSynchronization() { }
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/CMakeLists.txt        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -543,8 +543,6 @@
</span><span class="cx">     WebProcess/WebPage/FindController.cpp
</span><span class="cx">     WebProcess/WebPage/LayerTreeHost.cpp
</span><span class="cx">     WebProcess/WebPage/PageBanner.cpp
</span><del>-    WebProcess/WebPage/PageOverlay.cpp
-    WebProcess/WebPage/PageOverlayController.cpp
</del><span class="cx">     WebProcess/WebPage/TapHighlightController.cpp
</span><span class="cx">     WebProcess/WebPage/WebBackForwardListProxy.cpp
</span><span class="cx">     WebProcess/WebPage/WebContextMenu.cpp
</span><span class="lines">@@ -555,6 +553,7 @@
</span><span class="cx">     WebProcess/WebPage/WebOpenPanelResultListener.cpp
</span><span class="cx">     WebProcess/WebPage/WebPage.cpp
</span><span class="cx">     WebProcess/WebPage/WebPageGroupProxy.cpp
</span><ins>+    WebProcess/WebPage/WebPageOverlay.cpp
</ins><span class="cx">     WebProcess/WebPage/VisitedLinkTableController.cpp
</span><span class="cx">     WebProcess/WebPage/WebUndoStep.cpp
</span><span class="cx"> )
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,3 +1,134 @@
</span><ins>+2014-10-02  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Move PageOverlay[Controller] to WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=137164
+        &lt;rdar://problem/18508258&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * CMakeLists.txt:
+        * WebKit2.xcodeproj/project.pbxproj:
+        Make the appropriate build system changes.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        Make WKBundlePageOverlayRef map to WebPageOverlay instead of PageOverlay.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageInstallPageOverlay):
+        (WKBundlePageUninstallPageOverlay):
+        (WKBundlePageInstallPageOverlayWithAnimation):
+        (WKBundlePageUninstallPageOverlayWithAnimation):
+        Forward PageOverlay installation/uninstallation to WebCore.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
+        (WKBundlePageOverlayGetTypeID):
+        (WKBundlePageOverlayCreate):
+        (WKBundlePageOverlaySetAccessibilityClient):
+        Use WebPageOverlay instead of PageOverlay, and references instead of pointers.
+        We forward client callbacks through from PageOverlay::Client to WebPageOverlay::Client.
+
+        (PageOverlayClientImpl::copyAccessibilityAttributeValue):
+        (PageOverlayClientImpl::copyAccessibilityAttributeNames):
+        Convert from wtf types to WebKit2 types.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::graphicsLayerFactory):
+        If we don't have a drawing area, don't dereference it!
+
+        (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer):
+        Forward attachViewOverlayGraphicsLayer to the DrawingArea.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+
+        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+        * WebProcess/WebCoreSupport/WebInspectorClient.h:
+        * WebProcess/WebPage/FindController.cpp:
+        * WebProcess/WebPage/FindController.h:
+        * WebProcess/WebPage/ios/FindControllerIOS.mm:
+        * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
+        * WebProcess/WebPage/mac/ServicesOverlayController.mm:
+        * WebProcess/WebPage/ServicesOverlayController.h:
+        Mechanical changes to adopt to the fact that PageOverlay is in WebCore now.
+
+        * WebProcess/WebPage/LayerTreeHost.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        * WebProcess/WebPage/WebPage.h:
+        Remove support for WebKit2-based page overlays.
+        Return MainFrame instead of Frame from mainFrame().
+
+        * WebProcess/WebPage/WebPageOverlay.cpp: Added.
+        * WebProcess/WebPage/WebPageOverlay.h: Added.
+        (WebKit::WebPageOverlay::create):
+        (WebKit::WebPageOverlay::WebPageOverlay):
+        (WebKit::WebPageOverlay::~WebPageOverlay):
+        (WebKit::WebPageOverlay::setNeedsDisplay):
+        (WebKit::WebPageOverlay::clear):
+        (WebKit::WebPageOverlay::pageOverlayDestroyed):
+        (WebKit::WebPageOverlay::willMoveToPage):
+        (WebKit::WebPageOverlay::didMoveToPage):
+        (WebKit::WebPageOverlay::drawRect):
+        (WebKit::WebPageOverlay::mouseEvent):
+        (WebKit::WebPageOverlay::didScrollFrame):
+        (WebKit::WebPageOverlay::copyAccessibilityAttributeStringValueForPoint):
+        (WebKit::WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint):
+        (WebKit::WebPageOverlay::copyAccessibilityAttributeNames):
+        WebPageOverlay exists to be our API object, but forwards everything
+        to its WebCore::PageOverlay, and implements WebCore::PageOverlay::Client, and
+        forwards client callbacks to its WebPageOverlay::Client (which
+        WKBundlePageOverlay implements).
+
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
+        (-[WKAccessibilityWebPageObject accessibilityParameterizedAttributeNames]):
+        (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]):
+        Forward the three AX properties that PageOverlays are ever queried for
+        to the appropriate PageOverlayController function.
+        
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
+        (WebKit::RemoteLayerTreeDrawingArea::updateRootLayers):
+        Factor updateRootLayers out of setRootCompositingLayer.
+
+        (WebKit::RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer):
+        If we attach/detach the view-relative page overlay root layer,
+        reattach the root compositing layer's children.
+
+        (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
+        Ditto for the root compositing layer.
+
+        (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
+        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
+        (WebKit::RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged):
+        Informing PageOverlayController of exposed rect/document size changes is now
+        WebCore's job.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
+        (WebKit::TiledCoreAnimationDrawingArea::updateRootLayers):
+        Factor updateRootLayers out of setRootCompositingLayer.
+
+        (WebKit::TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer):
+        (WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
+        Make use of updateRootLayers when we attach/detach root compositing layer/view overlay layer.
+
+        (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged):
+        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+        (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
+        Informing PageOverlayController of exposed rect/document size changes is now
+        WebCore's job.
+
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::attachViewOverlayGraphicsLayer):
+
+        * Shared/WebRenderLayer.cpp:
+        * Shared/WebRenderObject.cpp:
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+        * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
+        * WebProcess/WebProcess.cpp:
+        Include MainFrame.h because WebPage::mainFrame returns a MainFrame now.
+
</ins><span class="cx"> 2014-10-02  Jeff Miller  &lt;jeffm@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WKDownloadCopyRequest() returns 0 until the download starts
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebRenderLayer.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebRenderLayer.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/Shared/WebRenderLayer.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameLoaderClient.h&gt;
</span><ins>+#include &lt;WebCore/MainFrame.h&gt;
</ins><span class="cx"> #include &lt;WebCore/RenderLayer.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderLayerBacking.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderView.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebRenderObject.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebRenderObject.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/Shared/WebRenderObject.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameLoaderClient.h&gt;
</span><ins>+#include &lt;WebCore/MainFrame.h&gt;
</ins><span class="cx"> #include &lt;WebCore/RenderText.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderView.h&gt;
</span><span class="cx"> #include &lt;WebCore/RenderWidget.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -307,8 +307,6 @@
</span><span class="cx">                 1A90C1EE1264FD50003E44D4 /* WebFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */; };
</span><span class="cx">                 1A90C1F41264FD71003E44D4 /* FindController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1F21264FD71003E44D4 /* FindController.h */; };
</span><span class="cx">                 1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A90C1F31264FD71003E44D4 /* FindController.cpp */; };
</span><del>-                1A90C23712650717003E44D4 /* PageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C23512650717003E44D4 /* PageOverlay.h */; };
-                1A90C23812650717003E44D4 /* PageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A90C23612650717003E44D4 /* PageOverlay.cpp */; };
</del><span class="cx">                 1A910071126675C4001842F5 /* FindIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A91006F126675C3001842F5 /* FindIndicator.h */; };
</span><span class="cx">                 1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* FindIndicator.cpp */; };
</span><span class="cx">                 1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */; };
</span><span class="lines">@@ -568,8 +566,6 @@
</span><span class="cx">                 29D55DF2161BF9F10031A2E3 /* WebPageGroupProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */; };
</span><span class="cx">                 2D125C5E1857EA05003BA3CB /* ViewGestureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */; };
</span><span class="cx">                 2D125C5F1857EA05003BA3CB /* ViewGestureControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */; };
</span><del>-                2D140EAF18F37BE0005E75A0 /* PageOverlayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D140EAD18F37BE0005E75A0 /* PageOverlayController.cpp */; };
-                2D140EB018F37BE0005E75A0 /* PageOverlayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D140EAE18F37BE0005E75A0 /* PageOverlayController.h */; };
</del><span class="cx">                 2D1B5D5D185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */; };
</span><span class="cx">                 2D1B5D5E185869C8006C6596 /* ViewGestureControllerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D1B5D5C185869C8006C6596 /* ViewGestureControllerMessages.h */; };
</span><span class="cx">                 2D28F3E41885CCC1004B9EAE /* WebChromeClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D28F3E01885CCC1004B9EAE /* WebChromeClientIOS.mm */; };
</span><span class="lines">@@ -586,6 +582,8 @@
</span><span class="cx">                 2D429BFD1721E2C700EC681F /* PDFPluginPasswordField.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D429BFB1721E2BA00EC681F /* PDFPluginPasswordField.mm */; };
</span><span class="cx">                 2D47B56C1810714E003A3AEE /* RemoteLayerBackingStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */; };
</span><span class="cx">                 2D47B56D1810714E003A3AEE /* RemoteLayerBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */; };
</span><ins>+                2D5C9D0519C81D8F00B3C5C1 /* WebPageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */; };
+                2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */; };
</ins><span class="cx">                 2D6AB541192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6AB53F192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h */; };
</span><span class="cx">                 2D6AB542192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D6AB540192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.mm */; };
</span><span class="cx">                 2D6B371B18A967AD0042AE80 /* _WKThumbnailView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D6B371918A967AD0042AE80 /* _WKThumbnailView.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2271,8 +2269,6 @@
</span><span class="cx">                 1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFindOptions.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A90C1F21264FD71003E44D4 /* FindController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A90C1F31264FD71003E44D4 /* FindController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                1A90C23512650717003E44D4 /* PageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageOverlay.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                1A90C23612650717003E44D4 /* PageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageOverlay.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 1A91006F126675C3001842F5 /* FindIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A910070126675C4001842F5 /* FindIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindIndicator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeContext.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -2558,8 +2554,6 @@
</span><span class="cx">                 29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageGroupProxyMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewGestureControllerMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                2D140EAD18F37BE0005E75A0 /* PageOverlayController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageOverlayController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                2D140EAE18F37BE0005E75A0 /* PageOverlayController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageOverlayController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 2D1B5D5A18586599006C6596 /* ViewGestureController.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = ViewGestureController.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D1B5D5B185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureControllerMessageReceiver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D1B5D5C185869C8006C6596 /* ViewGestureControllerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureControllerMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -2582,6 +2576,8 @@
</span><span class="cx">                 2D429BFB1721E2BA00EC681F /* PDFPluginPasswordField.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PDFPluginPasswordField.mm; path = PDF/PDFPluginPasswordField.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerBackingStore.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerBackingStore.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageOverlay.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageOverlay.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 2D6AB53F192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKPDFPageNumberIndicator.h; path = ios/WKPDFPageNumberIndicator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D6AB540192B1C4A003A9FD1 /* WKPDFPageNumberIndicator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKPDFPageNumberIndicator.mm; path = ios/WKPDFPageNumberIndicator.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2D6B371918A967AD0042AE80 /* _WKThumbnailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKThumbnailView.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5701,10 +5697,8 @@
</span><span class="cx">                                 1A90C1F21264FD71003E44D4 /* FindController.h */,
</span><span class="cx">                                 7C387433172F5615001BD88A /* PageBanner.cpp */,
</span><span class="cx">                                 7CF47FF917275C57008ACB91 /* PageBanner.h */,
</span><del>-                                1A90C23612650717003E44D4 /* PageOverlay.cpp */,
-                                1A90C23512650717003E44D4 /* PageOverlay.h */,
-                                2D140EAD18F37BE0005E75A0 /* PageOverlayController.cpp */,
-                                2D140EAE18F37BE0005E75A0 /* PageOverlayController.h */,
</del><ins>+                                2D5C9D0319C81D8F00B3C5C1 /* WebPageOverlay.cpp */,
+                                2D5C9D0419C81D8F00B3C5C1 /* WebPageOverlay.h */,
</ins><span class="cx">                                 5192D5711961FA2F00CD19AA /* ServicesOverlayController.h */,
</span><span class="cx">                                 2D819B99186275B3001F03D1 /* ViewGestureGeometryCollector.cpp */,
</span><span class="cx">                                 2D819B9A186275B3001F03D1 /* ViewGestureGeometryCollector.h */,
</span><span class="lines">@@ -7046,6 +7040,7 @@
</span><span class="cx">                                 7C85FD8019341665000177C4 /* WebPreferencesKeys.h in Headers */,
</span><span class="cx">                                 512F589712A8838800629530 /* AuthenticationChallengeProxy.h in Headers */,
</span><span class="cx">                                 1A445B9F184D5FB5004B3414 /* WKContextInjectedBundleClient.h in Headers */,
</span><ins>+                                2D5C9D0619C81D8F00B3C5C1 /* WebPageOverlay.h in Headers */,
</ins><span class="cx">                                 512F589912A8838800629530 /* AuthenticationDecisionListener.h in Headers */,
</span><span class="cx">                                 518E8EF916B2091C00E91429 /* AuthenticationManager.h in Headers */,
</span><span class="cx">                                 512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */,
</span><span class="lines">@@ -7153,7 +7148,6 @@
</span><span class="cx">                                 1AE52F9219201DA700A1FA37 /* APIContextConfiguration.h in Headers */,
</span><span class="cx">                                 7C361D731927FA360036A59D /* WebScriptMessageHandler.h in Headers */,
</span><span class="cx">                                 E105FE5418D7B9DE008F57A8 /* EditingRange.h in Headers */,
</span><del>-                                2D140EB018F37BE0005E75A0 /* PageOverlayController.h in Headers */,
</del><span class="cx">                                 BC17753F118BABF0007D9E9A /* GenericCallback.h in Headers */,
</span><span class="cx">                                 379A873618BBFA4300588AF2 /* _WKActivatedElementInfoInternal.h in Headers */,
</span><span class="cx">                                 BC06F42F12DBB9B6002D78DE /* GeolocationPermissionRequestManager.h in Headers */,
</span><span class="lines">@@ -7276,7 +7270,6 @@
</span><span class="cx">                                 1A5B1C511898606F004FCF9B /* WKNavigation.h in Headers */,
</span><span class="cx">                                 7CF47FFB17275C57008ACB91 /* PageBanner.h in Headers */,
</span><span class="cx">                                 BC6EDAA6111271C600E7678B /* PageClient.h in Headers */,
</span><del>-                                1A90C23712650717003E44D4 /* PageOverlay.h in Headers */,
</del><span class="cx">                                 C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */,
</span><span class="cx">                                 E19582D3153CBFD700B60875 /* PDFKitImports.h in Headers */,
</span><span class="cx">                                 1AE00D4F182D6F5000087DD7 /* WKBrowsingContextHandleInternal.h in Headers */,
</span><span class="lines">@@ -8928,7 +8921,6 @@
</span><span class="cx">                                 51E351F5180F5C7500E53BE9 /* WebIDBFactoryBackend.cpp in Sources */,
</span><span class="cx">                                 7C387434172F5615001BD88A /* PageBanner.cpp in Sources */,
</span><span class="cx">                                 7C6D37FC172F555F009D2847 /* PageBannerMac.mm in Sources */,
</span><del>-                                1A90C23812650717003E44D4 /* PageOverlay.cpp in Sources */,
</del><span class="cx">                                 C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */,
</span><span class="cx">                                 E19582D6153CC05400B60875 /* PDFKitImports.mm in Sources */,
</span><span class="cx">                                 2D870D1016234FFE000A3F20 /* PDFPlugin.mm in Sources */,
</span><span class="lines">@@ -9128,7 +9120,6 @@
</span><span class="cx">                                 A54293A5195A43DD002782C7 /* WKInspectorNodeSearchGestureRecognizer.mm in Sources */,
</span><span class="cx">                                 C0337DAE127A24FE008FF4F4 /* WebEvent.cpp in Sources */,
</span><span class="cx">                                 BC032DBA10F4380F0058C15A /* WebEventConversion.cpp in Sources */,
</span><del>-                                2D140EAF18F37BE0005E75A0 /* PageOverlayController.cpp in Sources */,
</del><span class="cx">                                 BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */,
</span><span class="cx">                                 A118A9EE1907AD6F00F7C92B /* QuickLookDocumentData.cpp in Sources */,
</span><span class="cx">                                 1A3DD1FD125E59F3004515E6 /* WebFindClient.cpp in Sources */,
</span><span class="lines">@@ -9212,6 +9203,7 @@
</span><span class="cx">                                 C06C6095124C144B0001682F /* WebPageCreationParameters.cpp in Sources */,
</span><span class="cx">                                 C59C4A5818B81174007BDCB6 /* AssistedNodeInformation.cpp in Sources */,
</span><span class="cx">                                 BC7B6207129A0A6700D174A4 /* WebPageGroup.cpp in Sources */,
</span><ins>+                                2D5C9D0519C81D8F00B3C5C1 /* WebPageOverlay.cpp in Sources */,
</ins><span class="cx">                                 BC7B625312A43C9600D174A4 /* WebPageGroupData.cpp in Sources */,
</span><span class="cx">                                 BC7B621612A4219A00D174A4 /* WebPageGroupProxy.cpp in Sources */,
</span><span class="cx">                                 29D55DF1161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundleAPICasth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -49,11 +49,11 @@
</span><span class="cx"> class InjectedBundleRangeHandle;
</span><span class="cx"> class InjectedBundleScriptWorld;
</span><span class="cx"> class PageBanner;
</span><del>-class PageOverlay;
</del><span class="cx"> class WebFrame;
</span><span class="cx"> class WebInspector;
</span><span class="cx"> class WebPage;
</span><span class="cx"> class WebPageGroupProxy;
</span><ins>+class WebPageOverlay;
</ins><span class="cx"> 
</span><span class="cx"> WK_ADD_API_MAPPING(WKBundleBackForwardListItemRef, InjectedBundleBackForwardListItem)
</span><span class="cx"> WK_ADD_API_MAPPING(WKBundleBackForwardListRef, InjectedBundleBackForwardList)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle)
</span><span class="cx"> WK_ADD_API_MAPPING(WKBundlePageBannerRef, PageBanner)
</span><span class="cx"> WK_ADD_API_MAPPING(WKBundlePageGroupRef, WebPageGroupProxy)
</span><del>-WK_ADD_API_MAPPING(WKBundlePageOverlayRef, PageOverlay)
</del><ins>+WK_ADD_API_MAPPING(WKBundlePageOverlayRef, WebPageOverlay)
</ins><span class="cx"> WK_ADD_API_MAPPING(WKBundlePageRef, WebPage)
</span><span class="cx"> WK_ADD_API_MAPPING(WKBundleRangeHandleRef, InjectedBundleRangeHandle)
</span><span class="cx"> WK_ADD_API_MAPPING(WKBundleRef, InjectedBundle)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -47,12 +47,15 @@
</span><span class="cx"> #include &quot;WebFullScreenManager.h&quot;
</span><span class="cx"> #include &quot;WebImage.h&quot;
</span><span class="cx"> #include &quot;WebPage.h&quot;
</span><ins>+#include &quot;WebPageOverlay.h&quot;
</ins><span class="cx"> #include &quot;WebRenderLayer.h&quot;
</span><span class="cx"> #include &quot;WebRenderObject.h&quot;
</span><span class="cx"> #include &lt;WebCore/AXObjectCache.h&gt;
</span><span class="cx"> #include &lt;WebCore/AccessibilityObject.h&gt;
</span><span class="cx"> #include &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><ins>+#include &lt;WebCore/PageOverlay.h&gt;
+#include &lt;WebCore/PageOverlayController.h&gt;
</ins><span class="cx"> #include &lt;WebCore/URL.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -354,22 +357,22 @@
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageInstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
</span><span class="cx"> {
</span><del>-    toImpl(pageRef)-&gt;installPageOverlay(toImpl(pageOverlayRef));
</del><ins>+    toImpl(pageRef)-&gt;mainFrame()-&gt;pageOverlayController().installPageOverlay(toImpl(pageOverlayRef)-&gt;coreOverlay(), WebCore::PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageUninstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
</span><span class="cx"> {
</span><del>-    toImpl(pageRef)-&gt;uninstallPageOverlay(toImpl(pageOverlayRef));
</del><ins>+    toImpl(pageRef)-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(toImpl(pageOverlayRef)-&gt;coreOverlay(), WebCore::PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageInstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
</span><span class="cx"> {
</span><del>-    toImpl(pageRef)-&gt;installPageOverlay(toImpl(pageOverlayRef), PageOverlay::FadeMode::Fade);
</del><ins>+    toImpl(pageRef)-&gt;mainFrame()-&gt;pageOverlayController().installPageOverlay(toImpl(pageOverlayRef)-&gt;coreOverlay(), WebCore::PageOverlay::FadeMode::Fade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageUninstallPageOverlayWithAnimation(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
</span><span class="cx"> {
</span><del>-    toImpl(pageRef)-&gt;uninstallPageOverlay(toImpl(pageOverlayRef), PageOverlay::FadeMode::Fade);
</del><ins>+    toImpl(pageRef)-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(toImpl(pageOverlayRef)-&gt;coreOverlay(), WebCore::PageOverlay::FadeMode::Fade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageSetTopOverhangImage(WKBundlePageRef pageRef, WKImageRef imageRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePageOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -27,10 +27,17 @@
</span><span class="cx"> #include &quot;WKBundlePageOverlay.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIClient.h&quot;
</span><del>-#include &quot;PageOverlay.h&quot;
</del><span class="cx"> #include &quot;WKAPICast.h&quot;
</span><ins>+#include &quot;WKArray.h&quot;
</ins><span class="cx"> #include &quot;WKBundleAPICast.h&quot;
</span><ins>+#include &quot;WKNumber.h&quot;
+#include &quot;WKRetainPtr.h&quot;
+#include &quot;WKSharedAPICast.h&quot;
+#include &quot;WKStringPrivate.h&quot;
</ins><span class="cx"> #include &lt;WebCore/GraphicsContext.h&gt;
</span><ins>+#include &lt;WebCore/PageOverlay.h&gt;
+#include &lt;WebCore/PlatformMouseEvent.h&gt;
+#include &lt;WebKit/WebPageOverlay.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace API {
</span><span class="cx"> 
</span><span class="lines">@@ -47,7 +54,7 @@
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><del>-class PageOverlayClientImpl : API::Client&lt;WKBundlePageOverlayClientBase&gt;, public PageOverlay::Client {
</del><ins>+class PageOverlayClientImpl : API::Client&lt;WKBundlePageOverlayClientBase&gt;, public WebPageOverlay::Client {
</ins><span class="cx"> public:
</span><span class="cx">     explicit PageOverlayClientImpl(WKBundlePageOverlayClientBase* client)
</span><span class="cx">     {
</span><span class="lines">@@ -60,64 +67,64 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    // PageOverlay::Client.
-    virtual void pageOverlayDestroyed(PageOverlay*)
</del><ins>+    // WebPageOverlay::Client.
+    virtual void pageOverlayDestroyed(WebPageOverlay&amp;) override
</ins><span class="cx">     {
</span><span class="cx">         delete this;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void willMoveToWebPage(PageOverlay* pageOverlay, WebPage* page)
</del><ins>+    virtual void willMoveToPage(WebPageOverlay&amp; pageOverlay, WebPage* page) override
</ins><span class="cx">     {
</span><span class="cx">         if (!m_client.willMoveToPage)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        m_client.willMoveToPage(toAPI(pageOverlay), toAPI(page), m_client.base.clientInfo);
</del><ins>+        m_client.willMoveToPage(toAPI(&amp;pageOverlay), toAPI(page), m_client.base.clientInfo);
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    virtual void didMoveToWebPage(PageOverlay* pageOverlay, WebPage* page)
</del><ins>+    virtual void didMoveToPage(WebPageOverlay&amp; pageOverlay, WebPage* page) override
</ins><span class="cx">     {
</span><span class="cx">         if (!m_client.didMoveToPage)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        m_client.didMoveToPage(toAPI(pageOverlay), toAPI(page), m_client.base.clientInfo);
</del><ins>+        m_client.didMoveToPage(toAPI(&amp;pageOverlay), toAPI(page), m_client.base.clientInfo);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual void drawRect(PageOverlay* pageOverlay, GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect)
</del><ins>+    virtual void drawRect(WebPageOverlay&amp; pageOverlay, GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect) override
</ins><span class="cx">     {
</span><span class="cx">         if (!m_client.drawRect)
</span><span class="cx">             return;
</span><span class="cx"> 
</span><del>-        m_client.drawRect(toAPI(pageOverlay), graphicsContext.platformContext(), toAPI(dirtyRect), m_client.base.clientInfo);
</del><ins>+        m_client.drawRect(toAPI(&amp;pageOverlay), graphicsContext.platformContext(), toAPI(dirtyRect), m_client.base.clientInfo);
</ins><span class="cx">     }
</span><span class="cx">     
</span><del>-    virtual bool mouseEvent(PageOverlay* pageOverlay, const WebMouseEvent&amp; event)
</del><ins>+    virtual bool mouseEvent(WebPageOverlay&amp; pageOverlay, const PlatformMouseEvent&amp; event) override
</ins><span class="cx">     {
</span><span class="cx">         switch (event.type()) {
</span><del>-        case WebEvent::MouseDown: {
</del><ins>+        case PlatformMouseEvent::Type::MousePressed: {
</ins><span class="cx">             if (!m_client.mouseDown)
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            return m_client.mouseDown(toAPI(pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
</del><ins>+            return m_client.mouseDown(toAPI(&amp;pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
</ins><span class="cx">         }
</span><del>-        case WebEvent::MouseUp: {
</del><ins>+        case PlatformMouseEvent::Type::MouseReleased: {
</ins><span class="cx">             if (!m_client.mouseUp)
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            return m_client.mouseUp(toAPI(pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
</del><ins>+            return m_client.mouseUp(toAPI(&amp;pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
</ins><span class="cx">         }
</span><del>-        case WebEvent::MouseMove: {
-            if (event.button() == WebMouseEvent::NoButton) {
</del><ins>+        case PlatformMouseEvent::Type::MouseMoved: {
+            if (event.button() == MouseButton::NoButton) {
</ins><span class="cx">                 if (!m_client.mouseMoved)
</span><span class="cx">                     return false;
</span><span class="cx"> 
</span><del>-                return m_client.mouseMoved(toAPI(pageOverlay), toAPI(event.position()), m_client.base.clientInfo);
</del><ins>+                return m_client.mouseMoved(toAPI(&amp;pageOverlay), toAPI(event.position()), m_client.base.clientInfo);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             // This is a MouseMove event with a mouse button pressed. Call mouseDragged.
</span><span class="cx">             if (!m_client.mouseDragged)
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            return m_client.mouseDragged(toAPI(pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
</del><ins>+            return m_client.mouseDragged(toAPI(&amp;pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         default:
</span><span class="lines">@@ -125,18 +132,43 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    virtual WKTypeRef copyAccessibilityAttributeValue(PageOverlay* pageOverlay, WKStringRef attribute, WKTypeRef parameter)
</del><ins>+    virtual bool copyAccessibilityAttributeStringValueForPoint(WebPageOverlay&amp; pageOverlay, String attribute, WebCore::FloatPoint parameter, String&amp; value) override
</ins><span class="cx">     {
</span><span class="cx">         if (!m_accessibilityClient.client().copyAccessibilityAttributeValue)
</span><del>-            return 0;
-        return m_accessibilityClient.client().copyAccessibilityAttributeValue(toAPI(pageOverlay), attribute, parameter, m_accessibilityClient.client().base.clientInfo);
</del><ins>+            return false;
+        auto wkType = m_accessibilityClient.client().copyAccessibilityAttributeValue(toAPI(&amp;pageOverlay), toCopiedAPI(attribute), WKPointCreate(WKPointMake(parameter.x(), parameter.y())), m_accessibilityClient.client().base.clientInfo);
+        if (toImpl(wkType)-&gt;type() != API::String::APIType)
+            return false;
+        value = toWTFString(static_cast&lt;WKStringRef&gt;(wkType));
+        return true;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual WKArrayRef copyAccessibilityAttributeNames(PageOverlay* pageOverlay, bool paramerizedNames)
</del><ins>+    virtual bool copyAccessibilityAttributeBoolValueForPoint(WebPageOverlay&amp; pageOverlay, String attribute, WebCore::FloatPoint parameter, bool&amp; value) override
</ins><span class="cx">     {
</span><ins>+        if (!m_accessibilityClient.client().copyAccessibilityAttributeValue)
+            return false;
+        auto wkType = m_accessibilityClient.client().copyAccessibilityAttributeValue(toAPI(&amp;pageOverlay), toCopiedAPI(attribute), WKPointCreate(WKPointMake(parameter.x(), parameter.y())), m_accessibilityClient.client().base.clientInfo);
+        if (toImpl(wkType)-&gt;type() != API::Boolean::APIType)
+            return false;
+        value = WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(wkType));
+        return true;
+    }
+
+    virtual Vector&lt;String&gt; copyAccessibilityAttributeNames(WebPageOverlay&amp; pageOverlay, bool paramerizedNames) override
+    {
+        Vector&lt;String&gt; names;
</ins><span class="cx">         if (!m_accessibilityClient.client().copyAccessibilityAttributeNames)
</span><del>-            return 0;
-        return m_accessibilityClient.client().copyAccessibilityAttributeNames(toAPI(pageOverlay), paramerizedNames, m_accessibilityClient.client().base.clientInfo);
</del><ins>+            return names;
+        auto wkNames = m_accessibilityClient.client().copyAccessibilityAttributeNames(toAPI(&amp;pageOverlay), paramerizedNames, m_accessibilityClient.client().base.clientInfo);
+
+        size_t count = WKArrayGetSize(wkNames);
+        for (size_t k = 0; k &lt; count; k++) {
+            WKTypeRef item = WKArrayGetItemAtIndex(wkNames, k);
+            if (toImpl(item)-&gt;type() == API::String::APIType)
+                names.append(toWTFString(static_cast&lt;WKStringRef&gt;(item)));
+        }
+
+        return names;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     API::Client&lt;WKBundlePageOverlayAccessibilityClientBase&gt; m_accessibilityClient;
</span><span class="lines">@@ -144,25 +176,25 @@
</span><span class="cx"> 
</span><span class="cx"> WKTypeID WKBundlePageOverlayGetTypeID()
</span><span class="cx"> {
</span><del>-    return toAPI(PageOverlay::APIType);
</del><ins>+    return toAPI(WebPageOverlay::APIType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WKBundlePageOverlayRef WKBundlePageOverlayCreate(WKBundlePageOverlayClientBase* wkClient)
</span><span class="cx"> {
</span><span class="cx">     if (wkClient &amp;&amp; wkClient-&gt;version)
</span><del>-        return 0;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><span class="cx">     auto clientImpl = std::make_unique&lt;PageOverlayClientImpl&gt;(wkClient);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Looks like this leaks the clientImpl.
</span><del>-    return toAPI(PageOverlay::create(clientImpl.release()).leakRef());
</del><ins>+    return toAPI(WebPageOverlay::create(*clientImpl.release()).leakRef());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageOverlaySetAccessibilityClient(WKBundlePageOverlayRef bundlePageOverlayRef, WKBundlePageOverlayAccessibilityClientBase* client)
</span><span class="cx"> {
</span><span class="cx">     if (client &amp;&amp; client-&gt;version)
</span><span class="cx">         return;
</span><del>-    static_cast&lt;PageOverlayClientImpl*&gt;(toImpl(bundlePageOverlayRef)-&gt;client())-&gt;setAccessibilityClient(client);
</del><ins>+    static_cast&lt;PageOverlayClientImpl&amp;&gt;(toImpl(bundlePageOverlayRef)-&gt;client()).setAccessibilityClient(client);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WKBundlePageOverlaySetNeedsDisplay(WKBundlePageOverlayRef bundlePageOverlayRef, WKRect rect)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKWebProcessPlugInBrowserContextControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #import &lt;WebCore/HTMLFormElement.h&gt;
</span><span class="cx"> #import &lt;WebCore/HTMLInputElement.h&gt;
</span><ins>+#import &lt;WebCore/MainFrame.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebKit;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -838,7 +838,9 @@
</span><span class="cx"> 
</span><span class="cx"> GraphicsLayerFactory* WebChromeClient::graphicsLayerFactory() const
</span><span class="cx"> {
</span><del>-    return m_page-&gt;drawingArea()-&gt;graphicsLayerFactory();
</del><ins>+    if (auto drawingArea = m_page-&gt;drawingArea())
+        return drawingArea-&gt;graphicsLayerFactory();
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><span class="lines">@@ -856,12 +858,10 @@
</span><span class="cx">         m_page-&gt;exitAcceleratedCompositingMode();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GraphicsLayer* WebChromeClient::documentOverlayLayerForFrame(Frame&amp; frame)
</del><ins>+void WebChromeClient::attachViewOverlayGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
</ins><span class="cx"> {
</span><del>-    if (&amp;frame == &amp;m_page-&gt;corePage()-&gt;mainFrame())
-        return m_page-&gt;pageOverlayController().documentOverlayRootLayer();
-
-    return nullptr;
</del><ins>+    if (auto drawingArea = m_page-&gt;drawingArea())
+        drawingArea-&gt;attachViewOverlayGraphicsLayer(frame, graphicsLayer);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebChromeClient::setNeedsOneShotDrawingSynchronization()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -215,10 +215,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual WebCore::GraphicsLayerFactory* graphicsLayerFactory() const override;
</span><span class="cx">     virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
</ins><span class="cx">     virtual void setNeedsOneShotDrawingSynchronization() override;
</span><span class="cx">     virtual void scheduleCompositingLayerFlush() override;
</span><span class="cx">     virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override;
</span><del>-    virtual WebCore::GraphicsLayer* documentOverlayLayerForFrame(WebCore::Frame&amp;) override;
</del><span class="cx"> 
</span><span class="cx"> #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
</span><span class="cx">     virtual PassRefPtr&lt;WebCore::DisplayRefreshMonitor&gt; createDisplayRefreshMonitor(PlatformDisplayID) const override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -32,7 +32,9 @@
</span><span class="cx"> #include &quot;WebInspector.h&quot;
</span><span class="cx"> #include &quot;WebPage.h&quot;
</span><span class="cx"> #include &lt;WebCore/InspectorController.h&gt;
</span><ins>+#include &lt;WebCore/MainFrame.h&gt;
</ins><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><ins>+#include &lt;WebCore/PageOverlayController.h&gt;
</ins><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -73,7 +75,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_paintRectOverlay)
</span><del>-        m_page-&gt;uninstallPageOverlay(m_paintRectOverlay.get());
</del><ins>+        m_page-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(m_paintRectOverlay.get(), PageOverlay::FadeMode::Fade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebInspectorClient::inspectorDestroyed()
</span><span class="lines">@@ -111,9 +113,9 @@
</span><span class="cx"> {
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     if (!m_highlightOverlay) {
</span><del>-        RefPtr&lt;PageOverlay&gt; highlightOverlay = PageOverlay::create(this);
</del><ins>+        RefPtr&lt;PageOverlay&gt; highlightOverlay = PageOverlay::create(*this);
</ins><span class="cx">         m_highlightOverlay = highlightOverlay.get();
</span><del>-        m_page-&gt;installPageOverlay(highlightOverlay.release(), PageOverlay::FadeMode::Fade);
</del><ins>+        m_page-&gt;mainFrame()-&gt;pageOverlayController().installPageOverlay(highlightOverlay.release(), PageOverlay::FadeMode::Fade);
</ins><span class="cx">         m_highlightOverlay-&gt;setNeedsDisplay();
</span><span class="cx">     } else {
</span><span class="cx">         m_highlightOverlay-&gt;stopFadeOutAnimation();
</span><span class="lines">@@ -130,7 +132,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     if (m_highlightOverlay)
</span><del>-        m_page-&gt;uninstallPageOverlay(m_highlightOverlay, PageOverlay::FadeMode::Fade);
</del><ins>+        m_page-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(m_highlightOverlay, PageOverlay::FadeMode::Fade);
</ins><span class="cx"> #else
</span><span class="cx">     m_page-&gt;hideInspectorHighlight();
</span><span class="cx"> #endif
</span><span class="lines">@@ -139,8 +141,8 @@
</span><span class="cx"> void WebInspectorClient::showPaintRect(const FloatRect&amp; rect)
</span><span class="cx"> {
</span><span class="cx">     if (!m_paintRectOverlay) {
</span><del>-        m_paintRectOverlay = PageOverlay::create(this, PageOverlay::OverlayType::Document);
-        m_page-&gt;installPageOverlay(m_paintRectOverlay, PageOverlay::FadeMode::DoNotFade);
</del><ins>+        m_paintRectOverlay = PageOverlay::create(*this, PageOverlay::OverlayType::Document);
+        m_page-&gt;mainFrame()-&gt;pageOverlayController().installPageOverlay(m_paintRectOverlay, PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!m_paintIndicatorLayerClient)
</span><span class="lines">@@ -167,8 +169,8 @@
</span><span class="cx">     
</span><span class="cx">     m_paintRectLayers.add(paintLayer.get());
</span><span class="cx"> 
</span><del>-    GraphicsLayer* overlayRootLayer = m_paintRectOverlay-&gt;layer();
-    overlayRootLayer-&gt;addChild(paintLayer.release());
</del><ins>+    GraphicsLayer&amp; overlayRootLayer = m_paintRectOverlay-&gt;layer();
+    overlayRootLayer.addChild(paintLayer.release());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebInspectorClient::animationEndedForLayer(const GraphicsLayer* layer)
</span><span class="lines">@@ -198,13 +200,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void WebInspectorClient::pageOverlayDestroyed(PageOverlay*)
</del><ins>+void WebInspectorClient::pageOverlayDestroyed(PageOverlay&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebInspectorClient::willMoveToWebPage(PageOverlay*, WebPage* webPage)
</del><ins>+void WebInspectorClient::willMoveToPage(PageOverlay&amp;, Page* page)
</ins><span class="cx"> {
</span><del>-    if (webPage)
</del><ins>+    if (page)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // The page overlay is moving away from the web page, reset it.
</span><span class="lines">@@ -212,16 +214,16 @@
</span><span class="cx">     m_highlightOverlay = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebInspectorClient::didMoveToWebPage(PageOverlay*, WebPage*)
</del><ins>+void WebInspectorClient::didMoveToPage(PageOverlay&amp;, Page*)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebInspectorClient::drawRect(PageOverlay*, WebCore::GraphicsContext&amp; context, const WebCore::IntRect&amp; /*dirtyRect*/)
</del><ins>+void WebInspectorClient::drawRect(PageOverlay&amp;, WebCore::GraphicsContext&amp; context, const WebCore::IntRect&amp; /*dirtyRect*/)
</ins><span class="cx"> {
</span><span class="cx">     m_page-&gt;corePage()-&gt;inspectorController().drawHighlight(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WebInspectorClient::mouseEvent(PageOverlay*, const WebMouseEvent&amp;)
</del><ins>+bool WebInspectorClient::mouseEvent(PageOverlay&amp;, const PlatformMouseEvent&amp;)
</ins><span class="cx"> {
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -28,16 +28,16 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx"> 
</span><del>-#include &quot;PageOverlay.h&quot;
-
</del><span class="cx"> #include &lt;WebCore/InspectorClient.h&gt;
</span><span class="cx"> #include &lt;WebCore/InspectorForwarding.h&gt;
</span><ins>+#include &lt;WebCore/PageOverlay.h&gt;
</ins><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> class GraphicsLayer;
</span><span class="cx"> class IntRect;
</span><ins>+class PageOverlay;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> class WebPage;
</span><span class="cx"> class RepaintIndicatorLayerClient;
</span><span class="cx"> 
</span><del>-class WebInspectorClient : public WebCore::InspectorClient, private PageOverlay::Client {
</del><ins>+class WebInspectorClient : public WebCore::InspectorClient, private WebCore::PageOverlay::Client {
</ins><span class="cx"> friend class RepaintIndicatorLayerClient;
</span><span class="cx"> public:
</span><span class="cx">     WebInspectorClient(WebPage*);
</span><span class="lines">@@ -74,18 +74,18 @@
</span><span class="cx">     virtual void showPaintRect(const WebCore::FloatRect&amp;) override;
</span><span class="cx"> 
</span><span class="cx">     // PageOverlay::Client
</span><del>-    virtual void pageOverlayDestroyed(PageOverlay*) override;
-    virtual void willMoveToWebPage(PageOverlay*, WebPage*) override;
-    virtual void didMoveToWebPage(PageOverlay*, WebPage*) override;
-    virtual void drawRect(PageOverlay*, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp;) override;
-    virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&amp;) override;
</del><ins>+    virtual void pageOverlayDestroyed(WebCore::PageOverlay&amp;) override;
+    virtual void willMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override;
+    virtual void didMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override;
+    virtual void drawRect(WebCore::PageOverlay&amp;, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp;) override;
+    virtual bool mouseEvent(WebCore::PageOverlay&amp;, const WebCore::PlatformMouseEvent&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     void animationEndedForLayer(const WebCore::GraphicsLayer*);
</span><span class="cx"> 
</span><span class="cx">     WebPage* m_page;
</span><del>-    PageOverlay* m_highlightOverlay;
</del><ins>+    WebCore::PageOverlay* m_highlightOverlay;
</ins><span class="cx">     
</span><del>-    RefPtr&lt;PageOverlay&gt; m_paintRectOverlay;
</del><ins>+    RefPtr&lt;WebCore::PageOverlay&gt; m_paintRectOverlay;
</ins><span class="cx">     std::unique_ptr&lt;RepaintIndicatorLayerClient&gt; m_paintIndicatorLayerClient;
</span><span class="cx">     HashSet&lt;WebCore::GraphicsLayer*&gt; m_paintRectLayers; // Ideally this would be HashSet&lt;std::unique_ptr&lt;GraphicsLayer&gt;&gt; but that doesn't work yet. webkit.org/b/136166
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebEditorClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #import &lt;WebCore/FocusController.h&gt;
</span><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #import &lt;WebCore/KeyboardEvent.h&gt;
</span><ins>+#import &lt;WebCore/MainFrame.h&gt;
</ins><span class="cx"> #import &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> #import &lt;WebCore/Page.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreNSURLExtras.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class DisplayRefreshMonitor;
</span><ins>+class Frame;
</ins><span class="cx"> class FrameView;
</span><span class="cx"> class GraphicsLayer;
</span><span class="cx"> class GraphicsLayerFactory;
</span><span class="lines">@@ -120,6 +121,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) { return false; }
</span><span class="cx"> 
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) { }
+
</ins><span class="cx"> protected:
</span><span class="cx">     DrawingArea(DrawingAreaType, WebPage&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -40,6 +40,8 @@
</span><span class="cx"> #include &lt;WebCore/GraphicsContext.h&gt;
</span><span class="cx"> #include &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><ins>+#include &lt;WebCore/PageOverlayController.h&gt;
+#include &lt;WebCore/PlatformMouseEvent.h&gt;
</ins><span class="cx"> #include &lt;WebCore/PluginDocument.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -63,7 +65,7 @@
</span><span class="cx"> 
</span><span class="cx"> FindController::FindController(WebPage* webPage)
</span><span class="cx">     : m_webPage(webPage)
</span><del>-    , m_findPageOverlay(0)
</del><ins>+    , m_findPageOverlay(nullptr)
</ins><span class="cx">     , m_isShowingFindIndicator(false)
</span><span class="cx">     , m_foundStringMatchIndex(-1)
</span><span class="cx"> {
</span><span class="lines">@@ -182,12 +184,12 @@
</span><span class="cx"> 
</span><span class="cx">     if (!shouldShowOverlay) {
</span><span class="cx">         if (m_findPageOverlay)
</span><del>-            m_webPage-&gt;uninstallPageOverlay(m_findPageOverlay, PageOverlay::FadeMode::Fade);
</del><ins>+            m_webPage-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(m_findPageOverlay, PageOverlay::FadeMode::Fade);
</ins><span class="cx">     } else {
</span><span class="cx">         if (!m_findPageOverlay) {
</span><del>-            RefPtr&lt;PageOverlay&gt; findPageOverlay = PageOverlay::create(this);
</del><ins>+            RefPtr&lt;PageOverlay&gt; findPageOverlay = PageOverlay::create(*this);
</ins><span class="cx">             m_findPageOverlay = findPageOverlay.get();
</span><del>-            m_webPage-&gt;installPageOverlay(findPageOverlay.release(), PageOverlay::FadeMode::Fade);
</del><ins>+            m_webPage-&gt;mainFrame()-&gt;pageOverlayController().installPageOverlay(findPageOverlay.release(), PageOverlay::FadeMode::Fade);
</ins><span class="cx">         }
</span><span class="cx">         m_findPageOverlay-&gt;setNeedsDisplay();
</span><span class="cx">     }
</span><span class="lines">@@ -330,7 +332,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_findMatches.clear();
</span><span class="cx">     if (m_findPageOverlay)
</span><del>-        m_webPage-&gt;uninstallPageOverlay(m_findPageOverlay, PageOverlay::FadeMode::Fade);
</del><ins>+        m_webPage-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(m_findPageOverlay, PageOverlay::FadeMode::Fade);
</ins><span class="cx"> 
</span><span class="cx">     PluginView* pluginView = pluginViewForFrame(m_webPage-&gt;mainFrame());
</span><span class="cx">     
</span><span class="lines">@@ -439,20 +441,20 @@
</span><span class="cx">     return rects;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FindController::pageOverlayDestroyed(PageOverlay*)
</del><ins>+void FindController::pageOverlayDestroyed(PageOverlay&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void FindController::willMoveToWebPage(PageOverlay*, WebPage* webPage)
</del><ins>+void FindController::willMoveToPage(PageOverlay&amp;, Page* page)
</ins><span class="cx"> {
</span><del>-    if (webPage)
</del><ins>+    if (page)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_findPageOverlay);
</span><span class="cx">     m_findPageOverlay = 0;
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-void FindController::didMoveToWebPage(PageOverlay*, WebPage*)
</del><ins>+void FindController::didMoveToPage(PageOverlay&amp;, Page*)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -468,7 +470,7 @@
</span><span class="cx"> const float shadowColorAlpha = 0.5;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void FindController::drawRect(PageOverlay*, GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect)
</del><ins>+void FindController::drawRect(PageOverlay&amp;, GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect)
</ins><span class="cx"> {
</span><span class="cx">     Color overlayBackgroundColor(0.1f, 0.1f, 0.1f, 0.25f);
</span><span class="cx"> 
</span><span class="lines">@@ -506,9 +508,9 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FindController::mouseEvent(PageOverlay*, const WebMouseEvent&amp; mouseEvent)
</del><ins>+bool FindController::mouseEvent(PageOverlay&amp;, const PlatformMouseEvent&amp; mouseEvent)
</ins><span class="cx"> {
</span><del>-    if (mouseEvent.type() == WebEvent::MouseDown)
</del><ins>+    if (mouseEvent.type() == PlatformEvent::MousePressed)
</ins><span class="cx">         hideFindUI();
</span><span class="cx"> 
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageFindControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -26,10 +26,10 @@
</span><span class="cx"> #ifndef FindController_h
</span><span class="cx"> #define FindController_h
</span><span class="cx"> 
</span><del>-#include &quot;PageOverlay.h&quot;
</del><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><span class="cx"> #include &quot;WebFindOptions.h&quot;
</span><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><ins>+#include &lt;WebCore/PageOverlay.h&gt;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="lines">@@ -45,10 +45,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class PageOverlay;
</del><span class="cx"> class WebPage;
</span><span class="cx"> 
</span><del>-class FindController : private PageOverlay::Client {
</del><ins>+class FindController : private WebCore::PageOverlay::Client {
</ins><span class="cx">     WTF_MAKE_NONCOPYABLE(FindController);
</span><span class="cx"> 
</span><span class="cx"> public:
</span><span class="lines">@@ -71,11 +70,11 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // PageOverlay::Client.
</span><del>-    virtual void pageOverlayDestroyed(PageOverlay*);
-    virtual void willMoveToWebPage(PageOverlay*, WebPage*);
-    virtual void didMoveToWebPage(PageOverlay*, WebPage*);
-    virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&amp;);
-    virtual void drawRect(PageOverlay*, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect);
</del><ins>+    virtual void pageOverlayDestroyed(WebCore::PageOverlay&amp;);
+    virtual void willMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*);
+    virtual void didMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*);
+    virtual bool mouseEvent(WebCore::PageOverlay&amp;, const WebCore::PlatformMouseEvent&amp;);
+    virtual void drawRect(WebCore::PageOverlay&amp;, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;WebCore::IntRect&gt; rectsForTextMatches();
</span><span class="cx">     bool getFindIndicatorBitmapAndRect(WebCore::Frame&amp;, ShareableBitmap::Handle&amp;, WebCore::IntRect&amp; selectionRect);
</span><span class="lines">@@ -88,7 +87,7 @@
</span><span class="cx">     void didHideFindIndicator();
</span><span class="cx"> 
</span><span class="cx">     WebPage* m_webPage;
</span><del>-    PageOverlay* m_findPageOverlay;
</del><ins>+    WebCore::PageOverlay* m_findPageOverlay;
</ins><span class="cx"> 
</span><span class="cx">     // Whether the UI process is showing the find indicator. Note that this can be true even if
</span><span class="cx">     // the find indicator isn't showing, but it will never be false when it is showing.
</span><span class="lines">@@ -99,7 +98,7 @@
</span><span class="cx">     int m_foundStringMatchIndex;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><del>-    RefPtr&lt;PageOverlay&gt; m_findIndicatorOverlay;
</del><ins>+    RefPtr&lt;WebCore::PageOverlay&gt; m_findIndicatorOverlay;
</ins><span class="cx">     std::unique_ptr&lt;FindIndicatorOverlayClientIOS&gt; m_findIndicatorOverlayClient;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class PageOverlay;
</del><span class="cx"> class UpdateInfo;
</span><span class="cx"> class WebPage;
</span><span class="cx"> 
</span><span class="lines">@@ -72,11 +71,6 @@
</span><span class="cx">     virtual void deviceOrPageScaleFactorChanged() = 0;
</span><span class="cx">     virtual void pageBackgroundTransparencyChanged() = 0;
</span><span class="cx"> 
</span><del>-    virtual void didInstallPageOverlay(PageOverlay*) { }
-    virtual void didUninstallPageOverlay(PageOverlay*) { }
-    virtual void setPageOverlayNeedsDisplay(PageOverlay*, const WebCore::IntRect&amp;) { }
-    virtual void setPageOverlayOpacity(PageOverlay*, float) { }
-
</del><span class="cx">     virtual void pauseRendering() { }
</span><span class="cx">     virtual void resumeRendering() { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagePageOverlaycpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,251 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;PageOverlay.h&quot;
-
-#include &quot;WebPage.h&quot;
-#include &quot;WebProcess.h&quot;
-#include &lt;WebCore/FrameView.h&gt;
-#include &lt;WebCore/GraphicsContext.h&gt;
-#include &lt;WebCore/MainFrame.h&gt;
-#include &lt;WebCore/Page.h&gt;
-#include &lt;WebCore/ScrollbarTheme.h&gt;
-#include &lt;wtf/CurrentTime.h&gt;
-
-using namespace WebCore;
-
-namespace WebKit {
-
-static const double fadeAnimationDuration = 0.2;
-static const double fadeAnimationFrameRate = 30;
-
-PassRefPtr&lt;PageOverlay&gt; PageOverlay::create(Client* client, OverlayType overlayType)
-{
-    return adoptRef(new PageOverlay(client, overlayType));
-}
-
-PageOverlay::PageOverlay(Client* client, OverlayType overlayType)
-    : m_client(client)
-    , m_webPage(nullptr)
-    , m_fadeAnimationTimer(RunLoop::main(), this, &amp;PageOverlay::fadeAnimationTimerFired)
-    , m_fadeAnimationStartTime(0)
-    , m_fadeAnimationDuration(fadeAnimationDuration)
-    , m_fadeAnimationType(NoAnimation)
-    , m_fractionFadedIn(1)
-    , m_overlayType(overlayType)
-    , m_backgroundColor(Color::transparent)
-{
-}
-
-PageOverlay::~PageOverlay()
-{
-}
-
-IntRect PageOverlay::bounds() const
-{
-    if (!m_overrideFrame.isEmpty())
-        return IntRect(IntPoint(), m_overrideFrame.size());
-
-    FrameView* frameView = m_webPage-&gt;mainFrameView();
-
-    switch (m_overlayType) {
-    case OverlayType::View: {
-        int width = frameView-&gt;width();
-        int height = frameView-&gt;height();
-
-        if (!ScrollbarTheme::theme()-&gt;usesOverlayScrollbars()) {
-            if (frameView-&gt;verticalScrollbar())
-                width -= frameView-&gt;verticalScrollbar()-&gt;width();
-            if (frameView-&gt;horizontalScrollbar())
-                height -= frameView-&gt;horizontalScrollbar()-&gt;height();
-        }
-        return IntRect(0, 0, width, height);
-    }
-    case OverlayType::Document:
-        return IntRect(IntPoint(), frameView-&gt;contentsSize());
-    };
-
-    ASSERT_NOT_REACHED();
-    return IntRect(IntPoint(), frameView-&gt;contentsSize());
-}
-
-IntRect PageOverlay::frame() const
-{
-    if (!m_overrideFrame.isEmpty())
-        return m_overrideFrame;
-
-    return bounds();
-}
-
-void PageOverlay::setFrame(IntRect frame)
-{
-    if (m_overrideFrame == frame)
-        return;
-
-    m_overrideFrame = frame;
-
-    if (m_webPage)
-        m_webPage-&gt;pageOverlayController().didChangeOverlayFrame(*this);
-}
-
-void PageOverlay::setBackgroundColor(RGBA32 backgroundColor)
-{
-    if (m_backgroundColor == backgroundColor)
-        return;
-
-    m_backgroundColor = backgroundColor;
-
-    if (m_webPage)
-        m_webPage-&gt;pageOverlayController().didChangeOverlayBackgroundColor(*this);
-}
-
-void PageOverlay::setPage(WebPage* webPage)
-{
-    m_client-&gt;willMoveToWebPage(this, webPage);
-    m_webPage = webPage;
-    m_client-&gt;didMoveToWebPage(this, webPage);
-
-    m_fadeAnimationTimer.stop();
-}
-
-void PageOverlay::setNeedsDisplay(const IntRect&amp; dirtyRect)
-{
-    if (!m_webPage)
-        return;
-
-    m_webPage-&gt;pageOverlayController().setPageOverlayOpacity(*this, m_fractionFadedIn);
-    m_webPage-&gt;pageOverlayController().setPageOverlayNeedsDisplay(*this, dirtyRect);
-}
-
-void PageOverlay::setNeedsDisplay()
-{
-    setNeedsDisplay(bounds());
-}
-
-void PageOverlay::drawRect(GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect)
-{
-    // If the dirty rect is outside the bounds, ignore it.
-    IntRect paintRect = intersection(dirtyRect, bounds());
-    if (paintRect.isEmpty())
-        return;
-
-    GraphicsContextStateSaver stateSaver(graphicsContext);
-    m_client-&gt;drawRect(this, graphicsContext, paintRect);
-}
-    
-bool PageOverlay::mouseEvent(const WebMouseEvent&amp; mouseEvent)
-{
-    IntPoint mousePositionInOverlayCoordinates(mouseEvent.position());
-
-    if (m_overlayType == PageOverlay::OverlayType::Document)
-        mousePositionInOverlayCoordinates = m_webPage-&gt;corePage()-&gt;mainFrame().view()-&gt;rootViewToContents(mousePositionInOverlayCoordinates);
-
-    // Ignore events outside the bounds.
-    if (!bounds().contains(mousePositionInOverlayCoordinates))
-        return false;
-
-    return m_client-&gt;mouseEvent(this, mouseEvent);
-}
-
-void PageOverlay::didScrollFrame(Frame* frame)
-{
-    m_client-&gt;didScrollFrame(this, frame);
-}
-
-WKTypeRef PageOverlay::copyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter)
-{
-    return m_client-&gt;copyAccessibilityAttributeValue(this, attribute, parameter);
-}
-
-WKArrayRef PageOverlay::copyAccessibilityAttributeNames(bool parameterizedNames)
-{
-    return m_client-&gt;copyAccessibilityAttributeNames(this, parameterizedNames);
-}
-
-void PageOverlay::startFadeInAnimation()
-{
-    m_fractionFadedIn = 0;
-    m_fadeAnimationType = FadeInAnimation;
-
-    startFadeAnimation();
-}
-
-void PageOverlay::startFadeOutAnimation()
-{
-    m_fractionFadedIn = 1;
-    m_fadeAnimationType = FadeOutAnimation;
-
-    startFadeAnimation();
-}
-
-void PageOverlay::stopFadeOutAnimation()
-{
-    m_fractionFadedIn = 1.0;
-    m_fadeAnimationTimer.stop();
-}
-
-void PageOverlay::startFadeAnimation()
-{
-    m_fadeAnimationStartTime = currentTime();
-    m_fadeAnimationTimer.startRepeating(1 / fadeAnimationFrameRate);
-}
-
-void PageOverlay::fadeAnimationTimerFired()
-{
-    float animationProgress = (currentTime() - m_fadeAnimationStartTime) / m_fadeAnimationDuration;
-
-    if (animationProgress &gt;= 1.0)
-        animationProgress = 1.0;
-
-    double sine = sin(piOverTwoFloat * animationProgress);
-    float fadeAnimationValue = sine * sine;
-
-    m_fractionFadedIn = (m_fadeAnimationType == FadeInAnimation) ? fadeAnimationValue : 1 - fadeAnimationValue;
-    m_webPage-&gt;pageOverlayController().setPageOverlayOpacity(*this, m_fractionFadedIn);
-
-    if (animationProgress == 1.0) {
-        m_fadeAnimationTimer.stop();
-
-        bool wasFadingOut = m_fadeAnimationType == FadeOutAnimation;
-        m_fadeAnimationType = NoAnimation;
-
-        // If this was a fade out, go ahead and uninstall the page overlay.
-        if (wasFadingOut)
-            m_webPage-&gt;uninstallPageOverlay(this, PageOverlay::FadeMode::DoNotFade);
-    }
-}
-
-void PageOverlay::clear()
-{
-    m_webPage-&gt;pageOverlayController().clearPageOverlay(*this);
-}
-
-WebCore::GraphicsLayer* PageOverlay::layer()
-{
-    return m_webPage-&gt;pageOverlayController().layerForOverlay(*this);
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagePageOverlayh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/PageOverlay.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,137 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PageOverlay_h
-#define PageOverlay_h
-
-#include &quot;APIObject.h&quot;
-#include &quot;WKBase.h&quot;
-#include &lt;WebCore/Color.h&gt;
-#include &lt;WebCore/IntRect.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RunLoop.h&gt;
-
-namespace WebCore {
-class Frame;
-class GraphicsContext;
-class GraphicsLayer;
-}
-
-namespace WebKit {
-
-class WebFrame;
-class WebMouseEvent;
-class WebPage;
-
-class PageOverlay : public API::ObjectImpl&lt;API::Object::Type::BundlePageOverlay&gt; {
-public:
-    class Client {
-    protected:
-        virtual ~Client() { }
-    
-    public:
-        virtual void pageOverlayDestroyed(PageOverlay*) = 0;
-        virtual void willMoveToWebPage(PageOverlay*, WebPage*) = 0;
-        virtual void didMoveToWebPage(PageOverlay*, WebPage*) = 0;
-        virtual void drawRect(PageOverlay*, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect) = 0;
-        virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&amp;) = 0;
-        virtual void didScrollFrame(PageOverlay*, WebCore::Frame*) { }
-
-        virtual WKTypeRef copyAccessibilityAttributeValue(PageOverlay*, WKStringRef /* attribute */, WKTypeRef /* parameter */) { return 0; }
-        virtual WKArrayRef copyAccessibilityAttributeNames(PageOverlay*, bool /* parameterizedNames */) { return 0; }
-    };
-
-    enum class OverlayType {
-        View, // Fixed to the view size; does not scale or scroll with the document, repaints on scroll.
-        Document, // Scales and scrolls with the document.
-    };
-
-    static PassRefPtr&lt;PageOverlay&gt; create(Client*, OverlayType = OverlayType::View);
-    virtual ~PageOverlay();
-
-    void setPage(WebPage*);
-    void setNeedsDisplay(const WebCore::IntRect&amp; dirtyRect);
-    void setNeedsDisplay();
-
-    void drawRect(WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect);
-    bool mouseEvent(const WebMouseEvent&amp;);
-    void didScrollFrame(WebCore::Frame*);
-
-    WKTypeRef copyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter);
-    WKArrayRef copyAccessibilityAttributeNames(bool parameterizedNames);
-    
-    void startFadeInAnimation();
-    void startFadeOutAnimation();
-    void stopFadeOutAnimation();
-
-    void clear();
-
-    Client* client() const { return m_client; }
-
-    enum class FadeMode { DoNotFade, Fade };
-
-    OverlayType overlayType() { return m_overlayType; }
-
-    WebCore::IntRect bounds() const;
-    WebCore::IntRect frame() const;
-    void setFrame(WebCore::IntRect);
-
-    WebCore::RGBA32 backgroundColor() const { return m_backgroundColor; }
-    void setBackgroundColor(WebCore::RGBA32);
-
-    WebCore::GraphicsLayer* layer();
-    
-protected:
-    explicit PageOverlay(Client*, OverlayType);
-
-private:
-    void startFadeAnimation();
-    void fadeAnimationTimerFired();
-
-    Client* m_client;
-    WebPage* m_webPage;
-
-    RunLoop::Timer&lt;PageOverlay&gt; m_fadeAnimationTimer;
-    double m_fadeAnimationStartTime;
-    double m_fadeAnimationDuration;
-
-    enum FadeAnimationType {
-        NoAnimation,
-        FadeInAnimation,
-        FadeOutAnimation,
-    };
-
-    FadeAnimationType m_fadeAnimationType;
-    float m_fractionFadedIn;
-
-    OverlayType m_overlayType;
-    WebCore::IntRect m_overrideFrame;
-
-    WebCore::RGBA32 m_backgroundColor;
-};
-
-} // namespace WebKit
-
-#endif // PageOverlay_h
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagePageOverlayControllercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,314 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;PageOverlayController.h&quot;
-
-#include &quot;DrawingArea.h&quot;
-#include &quot;PageOverlay.h&quot;
-#include &quot;WebPage.h&quot;
-#include &lt;WebCore/Frame.h&gt;
-#include &lt;WebCore/FrameView.h&gt;
-#include &lt;WebCore/GraphicsContext.h&gt;
-#include &lt;WebCore/GraphicsLayer.h&gt;
-#include &lt;WebCore/MainFrame.h&gt;
-#include &lt;WebCore/ScrollingCoordinator.h&gt;
-#include &lt;WebCore/Settings.h&gt;
-#include &lt;WebCore/TiledBacking.h&gt;
-
-using namespace WebCore;
-
-namespace WebKit {
-
-PageOverlayController::PageOverlayController(WebPage&amp; webPage)
-    : m_webPage(webPage)
-{
-}
-
-void PageOverlayController::initialize()
-{
-    ASSERT(!m_documentOverlayRootLayer);
-    ASSERT(!m_viewOverlayRootLayer);
-
-    m_documentOverlayRootLayer = GraphicsLayer::create(m_webPage.drawingArea()-&gt;graphicsLayerFactory(), *this);
-    m_viewOverlayRootLayer = GraphicsLayer::create(m_webPage.drawingArea()-&gt;graphicsLayerFactory(), *this);
-#ifndef NDEBUG
-    m_documentOverlayRootLayer-&gt;setName(&quot;Page Overlay container (document-relative)&quot;);
-    m_viewOverlayRootLayer-&gt;setName(&quot;Page Overlay container (view-relative)&quot;);
-#endif
-}
-
-static void updateOverlayGeometry(PageOverlay&amp; overlay, GraphicsLayer&amp; graphicsLayer)
-{
-    IntRect overlayFrame = overlay.frame();
-
-    if (overlayFrame.location() == graphicsLayer.position() &amp;&amp; overlayFrame.size() == graphicsLayer.size())
-        return;
-
-    graphicsLayer.setPosition(overlayFrame.location());
-    graphicsLayer.setSize(overlayFrame.size());
-}
-
-void PageOverlayController::installPageOverlay(PassRefPtr&lt;PageOverlay&gt; pageOverlay, PageOverlay::FadeMode fadeMode)
-{
-    ASSERT(m_documentOverlayRootLayer);
-    ASSERT(m_viewOverlayRootLayer);
-
-    RefPtr&lt;PageOverlay&gt; overlay = pageOverlay;
-
-    if (m_pageOverlays.contains(overlay))
-        return;
-
-    m_pageOverlays.append(overlay);
-    overlay-&gt;setPage(&amp;m_webPage);
-
-    if (fadeMode == PageOverlay::FadeMode::Fade)
-        overlay-&gt;startFadeInAnimation();
-
-    std::unique_ptr&lt;GraphicsLayer&gt; layer = GraphicsLayer::create(m_webPage.drawingArea()-&gt;graphicsLayerFactory(), *this);
-    layer-&gt;setAnchorPoint(FloatPoint3D());
-    layer-&gt;setBackgroundColor(overlay-&gt;backgroundColor());
-    updateOverlayGeometry(*overlay, *layer);
-#ifndef NDEBUG
-    layer-&gt;setName(&quot;Page Overlay content&quot;);
-#endif
-
-    updateSettingsForLayer(*layer);
-
-    switch (overlay-&gt;overlayType()) {
-    case PageOverlay::OverlayType::View:
-        m_viewOverlayRootLayer-&gt;addChild(layer.get());
-        break;
-    case PageOverlay::OverlayType::Document:
-        m_documentOverlayRootLayer-&gt;addChild(layer.get());
-        break;
-    }
-
-    m_overlayGraphicsLayers.set(overlay.get(), WTF::move(layer));
-
-    updateForceSynchronousScrollLayerPositionUpdates();
-}
-
-void PageOverlayController::uninstallPageOverlay(PageOverlay* overlay, PageOverlay::FadeMode fadeMode)
-{
-    if (fadeMode == PageOverlay::FadeMode::Fade) {
-        overlay-&gt;startFadeOutAnimation();
-        return;
-    }
-
-    overlay-&gt;setPage(nullptr);
-
-    m_overlayGraphicsLayers.take(overlay)-&gt;removeFromParent();
-
-    size_t overlayIndex = m_pageOverlays.find(overlay);
-    ASSERT(overlayIndex != notFound);
-    m_pageOverlays.remove(overlayIndex);
-
-    updateForceSynchronousScrollLayerPositionUpdates();
-}
-
-void PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates()
-{
-#if ENABLE(ASYNC_SCROLLING)
-    bool forceSynchronousScrollLayerPositionUpdates = false;
-
-    for (auto&amp; overlay : m_pageOverlays) {
-        if (overlay-&gt;overlayType() == PageOverlay::OverlayType::View)
-            forceSynchronousScrollLayerPositionUpdates = true;
-    }
-
-    if (Page* page = m_webPage.corePage()) {
-        if (ScrollingCoordinator* scrollingCoordinator = page-&gt;scrollingCoordinator())
-            scrollingCoordinator-&gt;setForceSynchronousScrollLayerPositionUpdates(forceSynchronousScrollLayerPositionUpdates);
-    }
-#endif
-}
-
-void PageOverlayController::setPageOverlayNeedsDisplay(PageOverlay&amp; overlay, const WebCore::IntRect&amp; dirtyRect)
-{
-    ASSERT(m_pageOverlays.contains(&amp;overlay));
-    GraphicsLayer&amp; graphicsLayer = *m_overlayGraphicsLayers.get(&amp;overlay);
-
-    if (!graphicsLayer.drawsContent()) {
-        graphicsLayer.setDrawsContent(true);
-        updateOverlayGeometry(overlay, graphicsLayer);
-    }
-
-    graphicsLayer.setNeedsDisplayInRect(dirtyRect);
-}
-
-void PageOverlayController::setPageOverlayOpacity(PageOverlay&amp; overlay, float opacity)
-{
-    ASSERT(m_pageOverlays.contains(&amp;overlay));
-    m_overlayGraphicsLayers.get(&amp;overlay)-&gt;setOpacity(opacity);
-}
-
-void PageOverlayController::clearPageOverlay(PageOverlay&amp; overlay)
-{
-    ASSERT(m_pageOverlays.contains(&amp;overlay));
-    m_overlayGraphicsLayers.get(&amp;overlay)-&gt;setDrawsContent(false);
-}
-
-GraphicsLayer* PageOverlayController::layerForOverlay(PageOverlay&amp; overlay) const
-{
-    ASSERT(m_pageOverlays.contains(&amp;overlay));
-    return m_overlayGraphicsLayers.get(&amp;overlay);
-}
-
-void PageOverlayController::didChangeViewSize()
-{
-    for (auto&amp; overlayAndLayer : m_overlayGraphicsLayers) {
-        if (overlayAndLayer.key-&gt;overlayType() == PageOverlay::OverlayType::View)
-            updateOverlayGeometry(*overlayAndLayer.key, *overlayAndLayer.value);
-    }
-}
-
-void PageOverlayController::didChangeDocumentSize()
-{
-    for (auto&amp; overlayAndLayer : m_overlayGraphicsLayers) {
-        if (overlayAndLayer.key-&gt;overlayType() == PageOverlay::OverlayType::Document)
-            updateOverlayGeometry(*overlayAndLayer.key, *overlayAndLayer.value);
-    }
-}
-
-void PageOverlayController::didChangePreferences()
-{
-    for (auto&amp; graphicsLayer : m_overlayGraphicsLayers.values())
-        updateSettingsForLayer(*graphicsLayer);
-}
-
-void PageOverlayController::didChangeDeviceScaleFactor()
-{
-    m_documentOverlayRootLayer-&gt;noteDeviceOrPageScaleFactorChangedIncludingDescendants();
-    m_viewOverlayRootLayer-&gt;noteDeviceOrPageScaleFactorChangedIncludingDescendants();
-
-    for (auto&amp; graphicsLayer : m_overlayGraphicsLayers.values())
-        graphicsLayer-&gt;setNeedsDisplay();
-}
-
-void PageOverlayController::didChangeExposedRect()
-{
-    m_webPage.drawingArea()-&gt;scheduleCompositingLayerFlush();
-}
-
-void PageOverlayController::didScrollFrame(Frame* frame)
-{
-    for (auto&amp; overlayAndLayer : m_overlayGraphicsLayers) {
-        if (overlayAndLayer.key-&gt;overlayType() == PageOverlay::OverlayType::View || !frame-&gt;isMainFrame())
-            overlayAndLayer.value-&gt;setNeedsDisplay();
-        overlayAndLayer.key-&gt;didScrollFrame(frame);
-    }
-}
-
-void PageOverlayController::flushPageOverlayLayers(FloatRect visibleRect)
-{
-    m_viewOverlayRootLayer-&gt;flushCompositingState(visibleRect);
-}
-
-void PageOverlayController::updateSettingsForLayer(GraphicsLayer&amp; layer)
-{
-    Settings&amp; settings = m_webPage.corePage()-&gt;settings();
-    layer.setAcceleratesDrawing(settings.acceleratedDrawingEnabled());
-    layer.setShowDebugBorder(settings.showDebugBorders());
-    layer.setShowRepaintCounter(settings.showRepaintCounter());
-}
-
-bool PageOverlayController::handleMouseEvent(const WebMouseEvent&amp; mouseEvent)
-{
-    if (!m_pageOverlays.size())
-        return false;
-
-    for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
-        if ((*it)-&gt;mouseEvent(mouseEvent))
-            return true;
-    }
-
-    return false;
-}
-
-WKTypeRef PageOverlayController::copyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter)
-{
-    if (!m_pageOverlays.size())
-        return nullptr;
-
-    for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
-        if (WKTypeRef value = (*it)-&gt;copyAccessibilityAttributeValue(attribute, parameter))
-            return value;
-    }
-
-    return nullptr;
-}
-
-WKArrayRef PageOverlayController::copyAccessibilityAttributesNames(bool parameterizedNames)
-{
-    if (!m_pageOverlays.size())
-        return nullptr;
-
-    for (auto it = m_pageOverlays.rbegin(), end = m_pageOverlays.rend(); it != end; ++it) {
-        if (WKArrayRef value = (*it)-&gt;copyAccessibilityAttributeNames(parameterizedNames))
-            return value;
-    }
-
-    return nullptr;
-}
-
-void PageOverlayController::paintContents(const WebCore::GraphicsLayer* graphicsLayer, WebCore::GraphicsContext&amp; graphicsContext, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect&amp; clipRect)
-{
-    for (auto it = m_overlayGraphicsLayers.begin(), end = m_overlayGraphicsLayers.end(); it != end; ++it) {
-        if (it-&gt;value.get() != graphicsLayer)
-            continue;
-
-        GraphicsContextStateSaver stateSaver(graphicsContext);
-        graphicsContext.clip(clipRect);
-        it-&gt;key-&gt;drawRect(graphicsContext, enclosingIntRect(clipRect));
-
-        return;
-    }
-}
-
-float PageOverlayController::deviceScaleFactor() const
-{
-    return m_webPage.corePage()-&gt;deviceScaleFactor();
-}
-
-void PageOverlayController::notifyFlushRequired(const WebCore::GraphicsLayer*)
-{
-    if (m_webPage.drawingArea())
-        m_webPage.drawingArea()-&gt;scheduleCompositingLayerFlush();
-}
-
-void PageOverlayController::didChangeOverlayFrame(PageOverlay&amp; overlay)
-{
-    ASSERT(m_pageOverlays.contains(&amp;overlay));
-    updateOverlayGeometry(overlay, *m_overlayGraphicsLayers.get(&amp;overlay));
-}
-
-void PageOverlayController::didChangeOverlayBackgroundColor(PageOverlay&amp; overlay)
-{
-    ASSERT(m_pageOverlays.contains(&amp;overlay));
-    m_overlayGraphicsLayers.get(&amp;overlay)-&gt;setBackgroundColor(overlay.backgroundColor());
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagePageOverlayControllerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/PageOverlayController.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef PageOverlayController_h
-#define PageOverlayController_h
-
-#include &quot;PageOverlay.h&quot;
-#include &quot;WKBase.h&quot;
-#include &lt;WebCore/GraphicsLayerClient.h&gt;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/Vector.h&gt;
-
-namespace WebCore {
-class Frame;
-}
-
-namespace WebKit {
-
-class WebMouseEvent;
-class WebPage;
-
-class PageOverlayController : public WebCore::GraphicsLayerClient {
-public:
-    PageOverlayController(WebPage&amp;);
-
-    void initialize();
-
-    WebCore::GraphicsLayer* documentOverlayRootLayer() const { return m_documentOverlayRootLayer.get(); }
-    WebCore::GraphicsLayer* viewOverlayRootLayer() const { return m_viewOverlayRootLayer.get(); }
-
-    void installPageOverlay(PassRefPtr&lt;PageOverlay&gt;, PageOverlay::FadeMode);
-    void uninstallPageOverlay(PageOverlay*, PageOverlay::FadeMode);
-
-    void setPageOverlayNeedsDisplay(PageOverlay&amp;, const WebCore::IntRect&amp;);
-    void setPageOverlayOpacity(PageOverlay&amp;, float);
-    void clearPageOverlay(PageOverlay&amp;);
-    WebCore::GraphicsLayer* layerForOverlay(PageOverlay&amp;) const;
-
-    void didChangeViewSize();
-    void didChangeDocumentSize();
-    void didChangePreferences();
-    void didChangeDeviceScaleFactor();
-    void didChangeExposedRect();
-    void didScrollFrame(WebCore::Frame*);
-
-    void didChangeOverlayFrame(PageOverlay&amp;);
-    void didChangeOverlayBackgroundColor(PageOverlay&amp;);
-
-    void flushPageOverlayLayers(WebCore::FloatRect);
-
-    bool handleMouseEvent(const WebMouseEvent&amp;);
-
-    // FIXME: We shouldn't use API types here.
-    WKTypeRef copyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter);
-    WKArrayRef copyAccessibilityAttributesNames(bool parameterizedNames);
-
-private:
-    void updateSettingsForLayer(WebCore::GraphicsLayer&amp;);
-    void updateForceSynchronousScrollLayerPositionUpdates();
-
-    // WebCore::GraphicsLayerClient
-    virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) override;
-    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&amp;, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect&amp; clipRect) override;
-    virtual float deviceScaleFactor() const override;
-    virtual bool shouldSkipLayerInDump(const WebCore::GraphicsLayer*) const override { return true; }
-
-    std::unique_ptr&lt;WebCore::GraphicsLayer&gt; m_documentOverlayRootLayer;
-    std::unique_ptr&lt;WebCore::GraphicsLayer&gt; m_viewOverlayRootLayer;
-    HashMap&lt;PageOverlay*, std::unique_ptr&lt;WebCore::GraphicsLayer&gt;&gt; m_overlayGraphicsLayers;
-    Vector&lt;RefPtr&lt;PageOverlay&gt;&gt; m_pageOverlays;
-    WebPage&amp; m_webPage;
-};
-
-} // namespace WebKit
-
-#endif // PageOverlayController_h
</del></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageServicesOverlayControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ServicesOverlayController.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ServicesOverlayController.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ServicesOverlayController.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -28,9 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
</span><span class="cx"> 
</span><del>-#include &quot;PageOverlay.h&quot;
</del><span class="cx"> #include &quot;WebFrame.h&quot;
</span><span class="cx"> #include &lt;WebCore/GraphicsLayerClient.h&gt;
</span><ins>+#include &lt;WebCore/PageOverlay.h&gt;
</ins><span class="cx"> #include &lt;WebCore/Range.h&gt;
</span><span class="cx"> #include &lt;WebCore/Timer.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="lines">@@ -39,7 +39,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class LayoutRect;
</span><del>-
</del><span class="cx"> struct GapRects;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -47,7 +46,7 @@
</span><span class="cx"> 
</span><span class="cx"> class WebPage;
</span><span class="cx"> 
</span><del>-class ServicesOverlayController : private PageOverlay::Client {
</del><ins>+class ServicesOverlayController : private WebCore::PageOverlay::Client {
</ins><span class="cx"> public:
</span><span class="cx">     ServicesOverlayController(WebPage&amp;);
</span><span class="cx">     ~ServicesOverlayController();
</span><span class="lines">@@ -98,12 +97,12 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // PageOverlay::Client
</span><del>-    virtual void pageOverlayDestroyed(PageOverlay*) override;
-    virtual void willMoveToWebPage(PageOverlay*, WebPage*) override;
-    virtual void didMoveToWebPage(PageOverlay*, WebPage*) override;
-    virtual void drawRect(PageOverlay*, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect) override;
-    virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&amp;) override;
-    virtual void didScrollFrame(PageOverlay*, WebCore::Frame*) override;
</del><ins>+    virtual void pageOverlayDestroyed(WebCore::PageOverlay&amp;) override;
+    virtual void willMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override;
+    virtual void didMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override;
+    virtual void drawRect(WebCore::PageOverlay&amp;, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect) override;
+    virtual bool mouseEvent(WebCore::PageOverlay&amp;, const WebCore::PlatformMouseEvent&amp;) override;
+    virtual void didScrollFrame(WebCore::PageOverlay&amp;, WebCore::Frame&amp;) override;
</ins><span class="cx"> 
</span><span class="cx">     void createOverlayIfNeeded();
</span><span class="cx">     void handleClick(const WebCore::IntPoint&amp;, Highlight&amp;);
</span><span class="lines">@@ -139,7 +138,7 @@
</span><span class="cx">     WebPage&amp; webPage() const { return m_webPage; }
</span><span class="cx"> 
</span><span class="cx">     WebPage&amp; m_webPage;
</span><del>-    PageOverlay* m_servicesOverlay;
</del><ins>+    WebCore::PageOverlay* m_servicesOverlay;
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Highlight&gt; m_activeHighlight;
</span><span class="cx">     RefPtr&lt;Highlight&gt; m_nextActiveHighlight;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -327,7 +327,6 @@
</span><span class="cx"> #if ENABLE(WEBGL)
</span><span class="cx">     , m_systemWebGLPolicy(WebGLAllowCreation)
</span><span class="cx"> #endif
</span><del>-    , m_pageOverlayController(*this)
</del><span class="cx"> {
</span><span class="cx">     ASSERT(m_pageID);
</span><span class="cx">     // FIXME: This is a non-ideal location for this Setting and
</span><span class="lines">@@ -366,7 +365,6 @@
</span><span class="cx"> 
</span><span class="cx">     m_drawingArea = DrawingArea::create(*this, parameters);
</span><span class="cx">     m_drawingArea-&gt;setPaintingEnabled(false);
</span><del>-    m_pageOverlayController.initialize();
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx">     m_useAsyncScrolling = parameters.store.getBoolValueForKey(WebPreferencesKey::threadedScrollingEnabledKey());
</span><span class="lines">@@ -1226,8 +1224,6 @@
</span><span class="cx">     if (view-&gt;useFixedLayout())
</span><span class="cx">         sendViewportAttributesChanged();
</span><span class="cx"> #endif
</span><del>-
-    m_pageOverlayController.didChangeViewSize();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(TILED_BACKING_STORE)
</span><span class="lines">@@ -1453,8 +1449,6 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_drawingArea-&gt;layerTreeHost())
</span><span class="cx">         m_drawingArea-&gt;layerTreeHost()-&gt;deviceOrPageScaleFactorChanged();
</span><del>-
-    m_pageOverlayController.didChangeDeviceScaleFactor();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> float WebPage::deviceScaleFactor() const
</span><span class="lines">@@ -1577,16 +1571,6 @@
</span><span class="cx">     injectedBundle-&gt;didReceiveMessageToPage(this, messageName, messageBody.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::installPageOverlay(PassRefPtr&lt;PageOverlay&gt; pageOverlay, PageOverlay::FadeMode fadeMode)
-{
-    m_pageOverlayController.installPageOverlay(pageOverlay, fadeMode);
-}
-
-void WebPage::uninstallPageOverlay(PageOverlay* pageOverlay, PageOverlay::FadeMode fadeMode)
-{
-    m_pageOverlayController.uninstallPageOverlay(pageOverlay, fadeMode);
-}
-
</del><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> void WebPage::setHeaderPageBanner(PassRefPtr&lt;PageBanner&gt; pageBanner)
</span><span class="cx"> {
</span><span class="lines">@@ -1914,7 +1898,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-    bool handled = m_pageOverlayController.handleMouseEvent(mouseEvent);
</del><ins>+    bool handled = false;
</ins><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     if (!handled &amp;&amp; m_headerBanner)
</span><span class="lines">@@ -1940,7 +1924,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::mouseEventSyncForTesting(const WebMouseEvent&amp; mouseEvent, bool&amp; handled)
</span><span class="cx"> {
</span><del>-    handled = m_pageOverlayController.handleMouseEvent(mouseEvent);
</del><ins>+    handled = false;
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     if (!handled &amp;&amp; m_headerBanner)
</span><span class="cx">         handled = m_headerBanner-&gt;mouseEvent(mouseEvent);
</span><span class="lines">@@ -2869,8 +2853,6 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_drawingArea)
</span><span class="cx">         m_drawingArea-&gt;updatePreferences(store);
</span><del>-
-    m_pageOverlayController.didChangePreferences();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -4093,7 +4075,7 @@
</span><span class="cx">     send(Messages::WebPageProxy::SetCanShortCircuitHorizontalWheelEvents(m_canShortCircuitHorizontalWheelEvents));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Frame* WebPage::mainFrame() const
</del><ins>+MainFrame* WebPage::mainFrame() const
</ins><span class="cx"> {
</span><span class="cx">     return m_page ? &amp;m_page-&gt;mainFrame() : nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -4808,8 +4790,6 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::didChangeScrollOffsetForFrame(Frame* frame)
</span><span class="cx"> {
</span><del>-    m_pageOverlayController.didScrollFrame(frame);
-
</del><span class="cx">     if (!frame-&gt;isMainFrame())
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include &quot;LayerTreeHost.h&quot;
</span><span class="cx"> #include &quot;MessageReceiver.h&quot;
</span><span class="cx"> #include &quot;MessageSender.h&quot;
</span><del>-#include &quot;PageOverlayController.h&quot;
</del><span class="cx"> #include &quot;Plugin.h&quot;
</span><span class="cx"> #include &quot;SandboxExtension.h&quot;
</span><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><span class="lines">@@ -140,7 +139,6 @@
</span><span class="cx"> class InjectedBundleBackForwardList;
</span><span class="cx"> class NotificationPermissionRequestManager;
</span><span class="cx"> class PageBanner;
</span><del>-class PageOverlay;
</del><span class="cx"> class PluginView;
</span><span class="cx"> class ServicesOverlayController;
</span><span class="cx"> class VisibleContentRectUpdateInfo;
</span><span class="lines">@@ -206,8 +204,6 @@
</span><span class="cx">     
</span><span class="cx">     InjectedBundleBackForwardList* backForwardList();
</span><span class="cx">     DrawingArea* drawingArea() const { return m_drawingArea.get(); }
</span><del>-    const PageOverlayController&amp; pageOverlayController() const { return m_pageOverlayController; }
-    PageOverlayController&amp; pageOverlayController() { return m_pageOverlayController; }
</del><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx">     WebCore::ScrollingCoordinator* scrollingCoordinator() const;
</span><span class="cx"> #endif
</span><span class="lines">@@ -312,7 +308,7 @@
</span><span class="cx"> 
</span><span class="cx">     WebFrame* mainWebFrame() const { return m_mainFrame.get(); }
</span><span class="cx"> 
</span><del>-    WebCore::Frame* mainFrame() const; // May return 0.
</del><ins>+    WebCore::MainFrame* mainFrame() const; // May return 0.
</ins><span class="cx">     WebCore::FrameView* mainFrameView() const; // May return 0.
</span><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;WebCore::Range&gt; currentSelectionAsRange();
</span><span class="lines">@@ -416,8 +412,6 @@
</span><span class="cx"> 
</span><span class="cx">     bool windowIsFocused() const;
</span><span class="cx">     bool windowAndWebPageAreFocused() const;
</span><del>-    void installPageOverlay(PassRefPtr&lt;PageOverlay&gt;, PageOverlay::FadeMode = PageOverlay::FadeMode::DoNotFade);
-    void uninstallPageOverlay(PageOverlay*, PageOverlay::FadeMode = PageOverlay::FadeMode::DoNotFade);
</del><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     void setHeaderPageBanner(PassRefPtr&lt;PageBanner&gt;);
</span><span class="lines">@@ -822,9 +816,6 @@
</span><span class="cx">     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
</span><span class="cx">     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
</span><span class="cx"> 
</span><del>-    WKTypeRef pageOverlayCopyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter);
-    WKArrayRef pageOverlayCopyAccessibilityAttributesNames(bool parameterizedNames);
-
</del><span class="cx">     PassRefPtr&lt;WebCore::DocumentLoader&gt; createDocumentLoader(WebCore::Frame&amp;, const WebCore::ResourceRequest&amp;, const WebCore::SubstituteData&amp;);
</span><span class="cx"> 
</span><span class="cx">     void getBytecodeProfile(uint64_t callbackID);
</span><span class="lines">@@ -1278,8 +1269,6 @@
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS) || ENABLE(TELEPHONE_NUMBER_DETECTION)
</span><span class="cx">     std::unique_ptr&lt;ServicesOverlayController&gt; m_servicesOverlayController;
</span><span class="cx"> #endif
</span><del>-
-    PageOverlayController m_pageOverlayController;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageOverlaycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.cpp (0 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.cpp                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebPageOverlay.h&quot;
+
+#include &quot;WebFrame.h&quot;
+#include &quot;WebPage.h&quot;
+#include &lt;WebCore/GraphicsLayer.h&gt;
+#include &lt;WebCore/PageOverlay.h&gt;
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr&lt;WebPageOverlay&gt; WebPageOverlay::create(WebPageOverlay::Client&amp; client, PageOverlay::OverlayType overlayType)
+{
+    return adoptRef(new WebPageOverlay(client, overlayType));
+}
+
+WebPageOverlay::WebPageOverlay(WebPageOverlay::Client&amp; client, PageOverlay::OverlayType overlayType)
+    : m_overlay(PageOverlay::create(*this, overlayType))
+    , m_client(client)
+{
+}
+
+WebPageOverlay::~WebPageOverlay()
+{
+}
+
+void WebPageOverlay::setNeedsDisplay(const IntRect&amp; dirtyRect)
+{
+    m_overlay-&gt;setNeedsDisplay(dirtyRect);
+}
+
+void WebPageOverlay::setNeedsDisplay()
+{
+    m_overlay-&gt;setNeedsDisplay();
+}
+
+void WebPageOverlay::clear()
+{
+    m_overlay-&gt;clear();
+}
+
+void WebPageOverlay::pageOverlayDestroyed(PageOverlay&amp;)
+{
+    m_client.pageOverlayDestroyed(*this);
+}
+
+void WebPageOverlay::willMoveToPage(PageOverlay&amp;, Page* page)
+{
+    m_client.willMoveToPage(*this, page ? WebPage::fromCorePage(page) : nullptr);
+}
+
+void WebPageOverlay::didMoveToPage(PageOverlay&amp;, Page* page)
+{
+    m_client.didMoveToPage(*this, page ? WebPage::fromCorePage(page) : nullptr);
+}
+
+void WebPageOverlay::drawRect(PageOverlay&amp;, GraphicsContext&amp; context, const IntRect&amp; dirtyRect)
+{
+    m_client.drawRect(*this, context, dirtyRect);
+}
+
+bool WebPageOverlay::mouseEvent(PageOverlay&amp;, const PlatformMouseEvent&amp; event)
+{
+    return m_client.mouseEvent(*this, event);
+}
+
+void WebPageOverlay::didScrollFrame(PageOverlay&amp;, Frame&amp; frame)
+{
+    m_client.didScrollFrame(*this, WebFrame::fromCoreFrame(frame));
+}
+
+bool WebPageOverlay::copyAccessibilityAttributeStringValueForPoint(PageOverlay&amp;, String attribute, FloatPoint parameter, String&amp; value)
+{
+    return m_client.copyAccessibilityAttributeStringValueForPoint(*this, attribute, parameter, value);
+}
+
+bool WebPageOverlay::copyAccessibilityAttributeBoolValueForPoint(PageOverlay&amp;, String attribute, FloatPoint parameter, bool&amp; value)
+{
+    return m_client.copyAccessibilityAttributeBoolValueForPoint(*this, attribute, parameter, value);
+}
+
+Vector&lt;String&gt; WebPageOverlay::copyAccessibilityAttributeNames(PageOverlay&amp;, bool parameterizedNames)
+{
+    return m_client.copyAccessibilityAttributeNames(*this, parameterizedNames);
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageOverlayh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.h (0 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageOverlay.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -0,0 +1,92 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebPageOverlay_h
+#define WebPageOverlay_h
+
+#include &quot;APIObject.h&quot;
+#include &lt;WebCore/FloatPoint.h&gt;
+#include &lt;WebCore/IntRect.h&gt;
+#include &lt;WebCore/PageOverlay.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+
+namespace WebKit {
+
+class WebFrame;
+class WebPage;
+
+class WebPageOverlay : public API::ObjectImpl&lt;API::Object::Type::BundlePageOverlay&gt;, private WebCore::PageOverlay::Client {
+public:
+    class Client {
+    protected:
+        virtual ~Client() { }
+
+    public:
+        virtual void pageOverlayDestroyed(WebPageOverlay&amp;) = 0;
+        virtual void willMoveToPage(WebPageOverlay&amp;, WebPage*) = 0;
+        virtual void didMoveToPage(WebPageOverlay&amp;, WebPage*) = 0;
+        virtual void drawRect(WebPageOverlay&amp;, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect) = 0;
+        virtual bool mouseEvent(WebPageOverlay&amp;, const WebCore::PlatformMouseEvent&amp;) = 0;
+        virtual void didScrollFrame(WebPageOverlay&amp;, WebFrame*) { }
+
+        virtual bool copyAccessibilityAttributeStringValueForPoint(WebPageOverlay&amp;, String /* attribute */, WebCore::FloatPoint /* parameter */, String&amp; value) { return false; }
+        virtual bool copyAccessibilityAttributeBoolValueForPoint(WebPageOverlay&amp;, String /* attribute */, WebCore::FloatPoint /* parameter */, bool&amp; value) { return false; }
+        virtual Vector&lt;String&gt; copyAccessibilityAttributeNames(WebPageOverlay&amp;, bool /* parameterizedNames */) { return Vector&lt;String&gt;(); }
+    };
+
+    static PassRefPtr&lt;WebPageOverlay&gt; create(Client&amp;, WebCore::PageOverlay::OverlayType = WebCore::PageOverlay::OverlayType::View);
+    virtual ~WebPageOverlay();
+
+    void setNeedsDisplay(const WebCore::IntRect&amp; dirtyRect);
+    void setNeedsDisplay();
+
+    void clear();
+
+    WebCore::PageOverlay* coreOverlay() const { return m_overlay.get(); }
+    Client&amp; client() const { return m_client; }
+
+private:
+    WebPageOverlay(Client&amp;, WebCore::PageOverlay::OverlayType);
+
+    // WebCore::PageOverlay::Client
+    virtual void pageOverlayDestroyed(WebCore::PageOverlay&amp;) override;
+    virtual void willMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override;
+    virtual void didMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override;
+    virtual void drawRect(WebCore::PageOverlay&amp;, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect) override;
+    virtual bool mouseEvent(WebCore::PageOverlay&amp;, const WebCore::PlatformMouseEvent&amp;) override;
+    virtual void didScrollFrame(WebCore::PageOverlay&amp;, WebCore::Frame&amp;) override;
+
+    virtual bool copyAccessibilityAttributeStringValueForPoint(WebCore::PageOverlay&amp;, String /* attribute */, WebCore::FloatPoint /* parameter */, String&amp; value) override;
+    virtual bool copyAccessibilityAttributeBoolValueForPoint(WebCore::PageOverlay&amp;, String /* attribute */, WebCore::FloatPoint /* parameter */, bool&amp; value) override;
+    virtual Vector&lt;String&gt; copyAccessibilityAttributeNames(WebCore::PageOverlay&amp;, bool /* parameterizedNames */) override;
+
+
+    RefPtr&lt;WebCore::PageOverlay&gt; m_overlay;
+    Client&amp; m_client;
+};
+
+} // namespace WebKit
+
+#endif // WebPageOverlay_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosFindControllerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/FindControllerIOS.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/FindControllerIOS.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/FindControllerIOS.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #import &lt;WebCore/GraphicsContext.h&gt;
</span><span class="cx"> #import &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #import &lt;WebCore/Page.h&gt;
</span><ins>+#import &lt;WebCore/PageOverlayController.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -52,12 +53,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-void FindIndicatorOverlayClientIOS::drawRect(PageOverlay* overlay, WebCore::GraphicsContext&amp; context, const WebCore::IntRect&amp; dirtyRect)
</del><ins>+void FindIndicatorOverlayClientIOS::drawRect(PageOverlay&amp; overlay, GraphicsContext&amp; context, const IntRect&amp; dirtyRect)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: Support multiple text rects.
</span><span class="cx"> 
</span><del>-    IntRect overlayFrame = overlay-&gt;frame();
-    IntRect overlayBounds = overlay-&gt;bounds();
</del><ins>+    IntRect overlayFrame = overlay.frame();
+    IntRect overlayBounds = overlay.bounds();
</ins><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx">         GraphicsContextStateSaver stateSaver(context);
</span><span class="lines">@@ -85,11 +86,11 @@
</span><span class="cx">     matchRect.inflateY(totalVerticalMargin);
</span><span class="cx"> 
</span><span class="cx">     if (m_findIndicatorOverlay)
</span><del>-        m_webPage-&gt;uninstallPageOverlay(m_findIndicatorOverlay.get());
</del><ins>+        m_webPage-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(m_findIndicatorOverlay.get(), PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx"> 
</span><span class="cx">     m_findIndicatorOverlayClient = std::make_unique&lt;FindIndicatorOverlayClientIOS&gt;(selectedFrame);
</span><del>-    m_findIndicatorOverlay = PageOverlay::create(m_findIndicatorOverlayClient.get(), PageOverlay::OverlayType::Document);
-    m_webPage-&gt;installPageOverlay(m_findIndicatorOverlay);
</del><ins>+    m_findIndicatorOverlay = PageOverlay::create(*m_findIndicatorOverlayClient, PageOverlay::OverlayType::Document);
+    m_webPage-&gt;mainFrame()-&gt;pageOverlayController().installPageOverlay(m_findIndicatorOverlay, PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx"> 
</span><span class="cx">     m_findIndicatorOverlay-&gt;setFrame(matchRect);
</span><span class="cx">     m_findIndicatorOverlay-&gt;setNeedsDisplay();
</span><span class="lines">@@ -106,7 +107,7 @@
</span><span class="cx">     if (!m_isShowingFindIndicator)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_webPage-&gt;uninstallPageOverlay(m_findIndicatorOverlay.get());
</del><ins>+    m_webPage-&gt;mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(m_findIndicatorOverlay.get(), PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx">     m_findIndicatorOverlay = nullptr;
</span><span class="cx">     m_isShowingFindIndicator = false;
</span><span class="cx">     m_foundStringMatchIndex = -1;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosFindIndicatorOverlayClientIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -26,13 +26,13 @@
</span><span class="cx"> #ifndef FindIndicatorOverlayClientIOS_h
</span><span class="cx"> #define FindIndicatorOverlayClientIOS_h
</span><span class="cx"> 
</span><del>-#import &quot;PageOverlay.h&quot;
</del><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #import &lt;WebCore/GraphicsContext.h&gt;
</span><ins>+#import &lt;WebCore/PageOverlay.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-class FindIndicatorOverlayClientIOS : public PageOverlay::Client {
</del><ins>+class FindIndicatorOverlayClientIOS : public WebCore::PageOverlay::Client {
</ins><span class="cx"> public:
</span><span class="cx">     FindIndicatorOverlayClientIOS(WebCore::Frame&amp; frame)
</span><span class="cx">         : m_frame(frame)
</span><span class="lines">@@ -40,11 +40,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    virtual void pageOverlayDestroyed(PageOverlay*) override { }
-    virtual void willMoveToWebPage(PageOverlay*, WebPage*) override { }
-    virtual void didMoveToWebPage(PageOverlay*, WebPage*) override { }
-    virtual void drawRect(PageOverlay*, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect) override;
-    virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&amp;) override { return false; }
</del><ins>+    virtual void pageOverlayDestroyed(WebCore::PageOverlay&amp;) override { }
+    virtual void willMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override { }
+    virtual void didMoveToPage(WebCore::PageOverlay&amp;, WebCore::Page*) override { }
+    virtual void drawRect(WebCore::PageOverlay&amp;, WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect) override;
+    virtual bool mouseEvent(WebCore::PageOverlay&amp;, const WebCore::PlatformMouseEvent&amp;) override { return false; }
</ins><span class="cx"> 
</span><span class="cx">     WebCore::Frame&amp; m_frame;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx">     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*) override;
</span><span class="cx">     virtual void scheduleCompositingLayerFlush() override;
</span><span class="cx">     virtual void scheduleCompositingLayerFlushImmediately() override;
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void addTransactionCallbackID(uint64_t callbackID) override;
</span><span class="cx"> 
</span><span class="lines">@@ -107,6 +108,7 @@
</span><span class="cx">     virtual bool adjustLayerFlushThrottling(WebCore::LayerFlushThrottleState::Flags) override;
</span><span class="cx"> 
</span><span class="cx">     void updateScrolledExposedRect();
</span><ins>+    void updateRootLayers();
</ins><span class="cx"> 
</span><span class="cx">     void layerFlushTimerFired(WebCore::Timer&lt;RemoteLayerTreeDrawingArea&gt;*);
</span><span class="cx">     void flushLayers();
</span><span class="lines">@@ -160,6 +162,9 @@
</span><span class="cx"> 
</span><span class="cx">     uint64_t m_currentTransactionID;
</span><span class="cx">     Vector&lt;RemoteLayerTreeTransaction::TransactionCallbackID&gt; m_pendingCallbackIDs;
</span><ins>+
+    WebCore::GraphicsLayer* m_contentLayer;
+    WebCore::GraphicsLayer* m_viewOverlayRootLayer;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> DRAWING_AREA_TYPE_CASTS(RemoteLayerTreeDrawingArea, type() == DrawingAreaTypeRemoteLayerTree);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacRemoteLayerTreeDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #import &lt;WebCore/FrameView.h&gt;
</span><span class="cx"> #import &lt;WebCore/MainFrame.h&gt;
</span><ins>+#import &lt;WebCore/PageOverlayController.h&gt;
</ins><span class="cx"> #import &lt;WebCore/RenderLayerCompositor.h&gt;
</span><span class="cx"> #import &lt;WebCore/RenderView.h&gt;
</span><span class="cx"> #import &lt;WebCore/Settings.h&gt;
</span><span class="lines">@@ -66,6 +67,8 @@
</span><span class="cx">     , m_hadFlushDeferredWhileWaitingForBackingStoreSwap(false)
</span><span class="cx">     , m_displayRefreshMonitorsToNotify(nullptr)
</span><span class="cx">     , m_currentTransactionID(0)
</span><ins>+    , m_contentLayer(nullptr)
+    , m_viewOverlayRootLayer(nullptr)
</ins><span class="cx"> {
</span><span class="cx">     webPage.corePage()-&gt;settings().setForceCompositingMode(true);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -113,15 +116,31 @@
</span><span class="cx">         m_displayRefreshMonitorsToNotify-&gt;remove(remoteMonitor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RemoteLayerTreeDrawingArea::setRootCompositingLayer(GraphicsLayer* rootLayer)
</del><ins>+void RemoteLayerTreeDrawingArea::updateRootLayers()
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;GraphicsLayer*&gt; children;
</span><del>-    if (rootLayer) {
-        children.append(rootLayer);
-        children.append(m_webPage.pageOverlayController().viewOverlayRootLayer());
</del><ins>+    if (m_contentLayer) {
+        children.append(m_contentLayer);
+        if (m_viewOverlayRootLayer)
+            children.append(m_viewOverlayRootLayer);
</ins><span class="cx">     }
</span><ins>+
</ins><span class="cx">     m_rootLayer-&gt;setChildren(children);
</span><ins>+}
</ins><span class="cx"> 
</span><ins>+void RemoteLayerTreeDrawingArea::attachViewOverlayGraphicsLayer(Frame* frame, GraphicsLayer* viewOverlayRootLayer)
+{
+    if (!frame-&gt;isMainFrame())
+        return;
+
+    m_viewOverlayRootLayer = viewOverlayRootLayer;
+    updateRootLayers();
+}
+
+void RemoteLayerTreeDrawingArea::setRootCompositingLayer(GraphicsLayer* rootLayer)
+{
+    m_contentLayer = rootLayer;
+    updateRootLayers();
</ins><span class="cx">     scheduleCompositingLayerFlush();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -234,8 +253,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     frameView-&gt;setExposedRect(m_scrolledExposedRect);
</span><del>-
-    m_webPage.pageOverlayController().didChangeExposedRect();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TiledBacking* RemoteLayerTreeDrawingArea::mainFrameTiledBacking() const
</span><span class="lines">@@ -321,8 +338,13 @@
</span><span class="cx"> 
</span><span class="cx">     FloatRect visibleRect(FloatPoint(), m_viewSize);
</span><span class="cx">     visibleRect.intersect(m_scrolledExposedRect);
</span><del>-    m_webPage.pageOverlayController().flushPageOverlayLayers(visibleRect);
</del><ins>+
</ins><span class="cx">     m_webPage.mainFrameView()-&gt;flushCompositingStateIncludingSubframes();
</span><ins>+
+    // Because our view-relative overlay root layer is not attached to the FrameView's GraphicsLayer tree, we need to flush it manually.
+    if (m_viewOverlayRootLayer)
+        m_viewOverlayRootLayer-&gt;flushCompositingState(visibleRect);
+
</ins><span class="cx">     m_rootLayer-&gt;flushCompositingStateForThisLayerOnly();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Minimize these transactions if nothing changed.
</span><span class="lines">@@ -410,7 +432,6 @@
</span><span class="cx"> void RemoteLayerTreeDrawingArea::mainFrameContentSizeChanged(const IntSize&amp; contentsSize)
</span><span class="cx"> {
</span><span class="cx">     m_rootLayer-&gt;setSize(contentsSize);
</span><del>-    m_webPage.pageOverlayController().didChangeDocumentSize();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RemoteLayerTreeDrawingArea::markLayersVolatileImmediatelyIfPossible()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacServicesOverlayControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #import &lt;WebCore/GraphicsLayer.h&gt;
</span><span class="cx"> #import &lt;WebCore/GraphicsLayerCA.h&gt;
</span><span class="cx"> #import &lt;WebCore/MainFrame.h&gt;
</span><ins>+#import &lt;WebCore/PageOverlayController.h&gt;
</ins><span class="cx"> #import &lt;WebCore/PlatformCAAnimationMac.h&gt;
</span><span class="cx"> #import &lt;WebCore/SoftLinking.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -225,23 +226,23 @@
</span><span class="cx">         highlight-&gt;invalidate();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ServicesOverlayController::pageOverlayDestroyed(PageOverlay*)
</del><ins>+void ServicesOverlayController::pageOverlayDestroyed(PageOverlay&amp;)
</ins><span class="cx"> {
</span><span class="cx">     // Before the overlay is destroyed, it should have moved out of the WebPage,
</span><span class="cx">     // at which point we already cleared our back pointer.
</span><span class="cx">     ASSERT(!m_servicesOverlay);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ServicesOverlayController::willMoveToWebPage(PageOverlay*, WebPage* webPage)
</del><ins>+void ServicesOverlayController::willMoveToPage(PageOverlay&amp;, Page* page)
</ins><span class="cx"> {
</span><del>-    if (webPage)
</del><ins>+    if (page)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_servicesOverlay);
</span><span class="cx">     m_servicesOverlay = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ServicesOverlayController::didMoveToWebPage(PageOverlay*, WebPage*)
</del><ins>+void ServicesOverlayController::didMoveToPage(PageOverlay&amp;, Page*)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -447,7 +448,7 @@
</span><span class="cx">     determineActiveHighlight(mouseIsOverButton);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ServicesOverlayController::drawRect(PageOverlay* overlay, GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect)
</del><ins>+void ServicesOverlayController::drawRect(PageOverlay&amp; overlay, GraphicsContext&amp; graphicsContext, const IntRect&amp; dirtyRect)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -583,7 +584,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_potentialHighlights.isEmpty()) {
</span><span class="cx">         if (m_servicesOverlay)
</span><del>-            m_webPage.uninstallPageOverlay(m_servicesOverlay);
</del><ins>+            m_webPage.mainFrame()-&gt;pageOverlayController().uninstallPageOverlay(m_servicesOverlay, PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -601,9 +602,9 @@
</span><span class="cx">     if (m_servicesOverlay)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;PageOverlay&gt; overlay = PageOverlay::create(this, PageOverlay::OverlayType::Document);
</del><ins>+    RefPtr&lt;PageOverlay&gt; overlay = PageOverlay::create(*this, PageOverlay::OverlayType::Document);
</ins><span class="cx">     m_servicesOverlay = overlay.get();
</span><del>-    m_webPage.installPageOverlay(overlay.release(), PageOverlay::FadeMode::DoNotFade);
</del><ins>+    m_webPage.mainFrame()-&gt;pageOverlayController().installPageOverlay(overlay.release(), PageOverlay::FadeMode::DoNotFade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Vector&lt;RefPtr&lt;Range&gt;&gt; ServicesOverlayController::telephoneNumberRangesForFocusedFrame()
</span><span class="lines">@@ -717,13 +718,13 @@
</span><span class="cx">         m_activeHighlight = m_nextActiveHighlight.release();
</span><span class="cx"> 
</span><span class="cx">         if (m_activeHighlight) {
</span><del>-            m_servicesOverlay-&gt;layer()-&gt;addChild(m_activeHighlight-&gt;layer());
</del><ins>+            m_servicesOverlay-&gt;layer().addChild(m_activeHighlight-&gt;layer());
</ins><span class="cx">             m_activeHighlight-&gt;fadeIn();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ServicesOverlayController::mouseEvent(PageOverlay*, const WebMouseEvent&amp; event)
</del><ins>+bool ServicesOverlayController::mouseEvent(PageOverlay&amp;, const PlatformMouseEvent&amp; event)
</ins><span class="cx"> {
</span><span class="cx">     m_mousePosition = m_webPage.corePage()-&gt;mainFrame().view()-&gt;rootViewToContents(event.position());
</span><span class="cx"> 
</span><span class="lines">@@ -731,13 +732,13 @@
</span><span class="cx">     determineActiveHighlight(mouseIsOverActiveHighlightButton);
</span><span class="cx"> 
</span><span class="cx">     // Cancel the potential click if any button other than the left button changes state, and ignore the event.
</span><del>-    if (event.button() != WebMouseEvent::LeftButton) {
</del><ins>+    if (event.button() != MouseButton::LeftButton) {
</ins><span class="cx">         m_currentMouseDownOnButtonHighlight = nullptr;
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If the mouse lifted while still over the highlight button that it went down on, then that is a click.
</span><del>-    if (event.type() == WebEvent::MouseUp) {
</del><ins>+    if (event.type() == PlatformEvent::MouseReleased) {
</ins><span class="cx">         RefPtr&lt;Highlight&gt; mouseDownHighlight = m_currentMouseDownOnButtonHighlight;
</span><span class="cx">         m_currentMouseDownOnButtonHighlight = nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -752,7 +753,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If the mouse moved outside of the button tracking a potential click, stop tracking the click.
</span><del>-    if (event.type() == WebEvent::MouseMove) {
</del><ins>+    if (event.type() == PlatformEvent::MouseMoved) {
</ins><span class="cx">         if (m_currentMouseDownOnButtonHighlight &amp;&amp; mouseIsOverActiveHighlightButton)
</span><span class="cx">             return true;
</span><span class="cx"> 
</span><span class="lines">@@ -761,7 +762,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If the mouse went down over the active highlight's button, track this as a potential click.
</span><del>-    if (event.type() == WebEvent::MouseDown) {
</del><ins>+    if (event.type() == PlatformEvent::MousePressed) {
</ins><span class="cx">         if (m_activeHighlight &amp;&amp; mouseIsOverActiveHighlightButton) {
</span><span class="cx">             m_currentMouseDownOnButtonHighlight = m_activeHighlight;
</span><span class="cx">             return true;
</span><span class="lines">@@ -773,9 +774,9 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ServicesOverlayController::didScrollFrame(PageOverlay*, Frame* frame)
</del><ins>+void ServicesOverlayController::didScrollFrame(PageOverlay&amp;, Frame&amp; frame)
</ins><span class="cx"> {
</span><del>-    if (frame-&gt;isMainFrame())
</del><ins>+    if (frame.isMainFrame())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     buildPhoneNumberHighlights();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -84,6 +84,8 @@
</span><span class="cx">     virtual void viewStateDidChange(WebCore::ViewState::Flags changed, bool wantsDidUpdateViewState) override;
</span><span class="cx">     void didUpdateViewStateTimerFired();
</span><span class="cx"> 
</span><ins>+    virtual void attachViewOverlayGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) override;
+
</ins><span class="cx">     // WebCore::LayerFlushSchedulerClient
</span><span class="cx">     virtual bool flushLayers() override;
</span><span class="cx"> 
</span><span class="lines">@@ -106,6 +108,7 @@
</span><span class="cx">     void updateLayerHostingContext();
</span><span class="cx"> 
</span><span class="cx">     void setRootCompositingLayer(CALayer *);
</span><ins>+    void updateRootLayers();
</ins><span class="cx"> 
</span><span class="cx">     WebCore::TiledBacking* mainFrameTiledBacking() const;
</span><span class="cx">     void updateDebugInfoLayer(bool showLayer);
</span><span class="lines">@@ -138,6 +141,8 @@
</span><span class="cx">     WebCore::TransformationMatrix m_transform;
</span><span class="cx"> 
</span><span class="cx">     RunLoop::Timer&lt;TiledCoreAnimationDrawingArea&gt; m_sendDidUpdateViewStateTimer;
</span><ins>+
+    WebCore::GraphicsLayer* m_viewOverlayRootLayer;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> DRAWING_AREA_TYPE_CASTS(TiledCoreAnimationDrawingArea, type() == DrawingAreaTypeTiledCoreAnimation);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacTiledCoreAnimationDrawingAreamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> #import &lt;WebCore/ScrollbarTheme.h&gt;
</span><span class="cx"> #import &lt;WebCore/Settings.h&gt;
</span><span class="cx"> #import &lt;WebCore/TiledBacking.h&gt;
</span><ins>+#import &lt;WebCore/WebActionDisablingCALayerDelegate.h&gt;
</ins><span class="cx"> #import &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="lines">@@ -76,10 +77,12 @@
</span><span class="cx">     , m_scrolledExposedRect(FloatRect::infiniteRect())
</span><span class="cx">     , m_transientZoomScale(1)
</span><span class="cx">     , m_sendDidUpdateViewStateTimer(RunLoop::main(), this, &amp;TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired)
</span><ins>+    , m_viewOverlayRootLayer(nullptr)
</ins><span class="cx"> {
</span><span class="cx">     m_webPage.corePage()-&gt;settings().setForceCompositingMode(true);
</span><span class="cx"> 
</span><span class="cx">     m_hostingLayer = [CALayer layer];
</span><ins>+    [m_hostingLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
</ins><span class="cx">     [m_hostingLayer setFrame:m_webPage.bounds()];
</span><span class="cx">     [m_hostingLayer setOpaque:YES];
</span><span class="cx">     [m_hostingLayer setGeometryFlipped:YES];
</span><span class="lines">@@ -204,9 +207,28 @@
</span><span class="cx">     updateDebugInfoLayer(showTiledScrollingIndicator);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TiledCoreAnimationDrawingArea::updateRootLayers()
+{
+    if (!m_rootLayer) {
+        [m_hostingLayer setSublayers:@[ ]];
+        return;
+    }
+
+    [m_hostingLayer setSublayers:m_viewOverlayRootLayer ? @[ m_rootLayer.get(), m_viewOverlayRootLayer-&gt;platformLayer() ] : @[ m_rootLayer.get() ]];
+}
+
+void TiledCoreAnimationDrawingArea::attachViewOverlayGraphicsLayer(Frame* frame, GraphicsLayer* viewOverlayRootLayer)
+{
+    if (!frame-&gt;isMainFrame())
+        return;
+
+    m_viewOverlayRootLayer = viewOverlayRootLayer;
+    updateRootLayers();
+}
+
</ins><span class="cx"> void TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged(const IntSize&amp; size)
</span><span class="cx"> {
</span><del>-    m_webPage.pageOverlayController().didChangeDocumentSize();
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TiledCoreAnimationDrawingArea::updateIntrinsicContentSizeIfNeeded()
</span><span class="lines">@@ -283,8 +305,11 @@
</span><span class="cx"> 
</span><span class="cx">     FloatRect visibleRect = [m_hostingLayer frame];
</span><span class="cx">     visibleRect.intersect(m_scrolledExposedRect);
</span><del>-    m_webPage.pageOverlayController().flushPageOverlayLayers(visibleRect);
</del><span class="cx"> 
</span><ins>+    // Because our view-relative overlay root layer is not attached to the main GraphicsLayer tree, we need to flush it manually.
+    if (m_viewOverlayRootLayer)
+        m_viewOverlayRootLayer-&gt;flushCompositingState(visibleRect);
+
</ins><span class="cx">     bool returnValue = m_webPage.mainFrameView()-&gt;flushCompositingStateIncludingSubframes();
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="cx">     if (ScrollingCoordinator* scrollingCoordinator = m_webPage.corePage()-&gt;scrollingCoordinator())
</span><span class="lines">@@ -363,8 +388,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     frameView-&gt;setExposedRect(m_scrolledExposedRect);
</span><del>-
-    m_webPage.pageOverlayController().didChangeExposedRect();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize&amp; viewSize, const IntSize&amp; layerPosition)
</span><span class="lines">@@ -464,12 +487,12 @@
</span><span class="cx">     [CATransaction begin];
</span><span class="cx">     [CATransaction setDisableActions:YES];
</span><span class="cx"> 
</span><del>-    [m_hostingLayer setSublayers:layer ? @[ layer, m_webPage.pageOverlayController().viewOverlayRootLayer()-&gt;platformLayer() ] : @[ ]];
-
</del><span class="cx">     bool hadRootLayer = !!m_rootLayer;
</span><span class="cx">     m_rootLayer = layer;
</span><span class="cx">     [m_rootLayer setSublayerTransform:m_transform];
</span><span class="cx"> 
</span><ins>+    updateRootLayers();
+
</ins><span class="cx">     if (hadRootLayer != !!layer)
</span><span class="cx">         m_layerHostingContext-&gt;setRootLayer(layer ? m_hostingLayer.get() : 0);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWKAccessibilityWebPageObjectMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #import &lt;WebCore/FrameView.h&gt;
</span><span class="cx"> #import &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #import &lt;WebCore/Page.h&gt;
</span><ins>+#import &lt;WebCore/PageOverlayController.h&gt;
</ins><span class="cx"> #import &lt;WebCore/ScrollView.h&gt;
</span><span class="cx"> #import &lt;WebCore/Scrollbar.h&gt;
</span><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><span class="lines">@@ -75,19 +76,13 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSArray *)accessibilityParameterizedAttributeNames
</span><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKArrayRef&gt; result = adoptWK(m_page-&gt;pageOverlayController().copyAccessibilityAttributesNames(true));
-    if (!result)
</del><ins>+    Vector&lt;String&gt; result = m_page-&gt;mainFrame()-&gt;pageOverlayController().copyAccessibilityAttributesNames(true);
+    if (result.isEmpty())
</ins><span class="cx">         return nil;
</span><span class="cx">     
</span><span class="cx">     NSMutableArray *names = [NSMutableArray array];
</span><del>-    size_t count = WKArrayGetSize(result.get());
-    for (size_t k = 0; k &lt; count; k++) {
-        WKTypeRef item = WKArrayGetItemAtIndex(result.get(), k);
-        if (toImpl(item)-&gt;type() == API::String::APIType) {
-            RetainPtr&lt;CFStringRef&gt; name = adoptCF(WKStringCopyCFString(kCFAllocatorDefault, (WKStringRef)item));
-            [names addObject:(NSString *)name.get()];
-        }
-    }
</del><ins>+    for (auto&amp; name : result)
+        [names addObject:(NSString *)name];
</ins><span class="cx">     
</span><span class="cx">     return names;
</span><span class="cx"> }
</span><span class="lines">@@ -164,23 +159,26 @@
</span><span class="cx"> 
</span><span class="cx"> - (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter
</span><span class="cx"> {
</span><del>-    WKRetainPtr&lt;WKTypeRef&gt; pageOverlayParameter = 0;
-    
-    if ([parameter isKindOfClass:[NSValue class]] &amp;&amp; strcmp([(NSValue*)parameter objCType], @encode(NSPoint)) == 0) {
-        NSPoint point = [self convertScreenPointToRootView:[(NSValue *)parameter pointValue]];
-        pageOverlayParameter = WKPointCreate(WKPointMake(point.x, point.y));
-    }
-    
-    WKRetainPtr&lt;WKStringRef&gt; attributeRef = adoptWK(WKStringCreateWithCFString((CFStringRef)attribute));
-    WKRetainPtr&lt;WKTypeRef&gt; result = adoptWK(m_page-&gt;pageOverlayController().copyAccessibilityAttributeValue(attributeRef.get(), pageOverlayParameter.get()));
-    if (!result)
</del><ins>+    WebCore::FloatPoint pageOverlayPoint;
+    if ([parameter isKindOfClass:[NSValue class]] &amp;&amp; !strcmp([(NSValue *)parameter objCType], @encode(NSPoint)))
+        pageOverlayPoint = [self convertScreenPointToRootView:[(NSValue *)parameter pointValue]];
+    else
</ins><span class="cx">         return nil;
</span><del>-    
-    if (toImpl(result.get())-&gt;type() == API::String::APIType)
-        return CFBridgingRelease(WKStringCopyCFString(kCFAllocatorDefault, (WKStringRef)result.get()));
-    if (toImpl(result.get())-&gt;type() == API::Boolean::APIType)
-        return [NSNumber numberWithBool:WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(result.get()))];
-    
</del><ins>+
+    if ([attribute isEqualToString:@&quot;AXDataDetectorExistsAtPoint&quot;] || [attribute isEqualToString:@&quot;AXDidShowDataDetectorMenuAtPoint&quot;]) {
+        bool value;
+        if (!m_page-&gt;mainFrame()-&gt;pageOverlayController().copyAccessibilityAttributeBoolValueForPoint(attribute, pageOverlayPoint, value))
+            return nil;
+        return [NSNumber numberWithBool:value];
+    }
+
+    if ([attribute isEqualToString:@&quot;AXDataDetectorTypeAtPoint&quot;]) {
+        String value;
+        if (!m_page-&gt;mainFrame()-&gt;pageOverlayController().copyAccessibilityAttributeStringValueForPoint(attribute, pageOverlayPoint, value))
+            return nil;
+        return [NSString stringWithString:value];
+    }
+
</ins><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (174230 => 174231)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-10-02 21:01:08 UTC (rev 174230)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2014-10-02 21:06:14 UTC (rev 174231)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> #include &lt;WebCore/IconDatabase.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSDOMWindow.h&gt;
</span><span class="cx"> #include &lt;WebCore/Language.h&gt;
</span><ins>+#include &lt;WebCore/MainFrame.h&gt;
</ins><span class="cx"> #include &lt;WebCore/MemoryCache.h&gt;
</span><span class="cx"> #include &lt;WebCore/MemoryPressureHandler.h&gt;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span></span></pre>
</div>
</div>

</body>
</html>