<!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>[170406] 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/170406">170406</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-06-24 16:50:07 -0700 (Tue, 24 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS]: WK2 Inspector Node Highlighting
https://bugs.webkit.org/show_bug.cgi?id=134257

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2014-06-24
Reviewed by Timothy Hatcher.

Source/WebCore:
Some clients want to get highlights with the scroll applied,
others do not. Provide a CoordinateSpace param to be used for
getting a highlight (only used on iOS).

* WebCore.exp.in:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::getHighlight):
* inspector/InspectorController.h:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::getHighlight):
(WebCore::buildObjectForRendererFragments):
* inspector/InspectorOverlay.h:
(WebCore::Highlight::Highlight):
* testing/Internals.cpp:
(WebCore::Internals::inspectorHighlightRects):

Source/WebKit/mac:
* WebInspector/WebNodeHighlightView.mm:
(-[WebNodeHighlightView layoutSublayers:]):

Source/WebKit2:
* Scripts/webkit2/messages.py:
(struct_or_class):
(headers_for_type):
* Shared/WebCoreArgumentCoders.h:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;Highlight&gt;::encode):
(IPC::ArgumentCoder&lt;Highlight&gt;::decode):
Add a way to encode a WebCore::Highlight struct.

* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showInspectorHighlight:WebCore::]):
(-[WKWebView _hideInspectorHighlight]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showInspectorHighlight):
(WebKit::PageClientImpl::hideInspectorHighlight):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::showInspectorHighlight):
(WebKit::WebPageProxy::hideInspectorHighlight):
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::highlight):
(WebKit::WebInspectorClient::hideHighlight):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::showInspectorHighlight):
(WebKit::WebPage::hideInspectorHighlight):
Send web process highlight / hideHighlight messages up to
the UIProcess so it can highlight in the WKContentView.
Pass up a WebCore::Highlight in Document coordinates.

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKInspectorHighlightView initWithFrame:]):
(-[WKInspectorHighlightView dealloc]):
(-[WKInspectorHighlightView _removeAllLayers]):
(-[WKInspectorHighlightView _createLayers:]):
(findIntersectionOnLineBetweenPoints):
(quadIntersection):
(layerPathWithHole):
(layerPath):
(-[WKInspectorHighlightView _layoutForNodeHighlight:]):
(-[WKInspectorHighlightView _layoutForRectsHighlight:]):
(-[WKInspectorHighlightView update:]):
Reuse the WebKit1 code to turn highlight float quads into CAShapeLayers.

(-[WKContentView _showInspectorHighlight:WebCore::]):
(-[WKContentView _hideInspectorHighlight]):
Show and hide the highlight view with the respective WebCore::Highlight.</pre>

<h3>Modified Paths</h3>
<ul>
<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="#trunkSourceWebCoreinspectorInspectorControllercpp">trunk/Source/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllerh">trunk/Source/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlayh">trunk/Source/WebCore/inspector/InspectorOverlay.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin">trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebInspectorWebNodeHighlightViewmm">trunk/Source/WebKit/mac/WebInspector/WebNodeHighlightView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2Scriptswebkit2messagespy">trunk/Source/WebKit2/Scripts/webkit2/messages.py</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewh">trunk/Source/WebKit2/UIProcess/ios/WKContentView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebCore/ChangeLog        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-06-24  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        [iOS]: WK2 Inspector Node Highlighting
+        https://bugs.webkit.org/show_bug.cgi?id=134257
+
+        Reviewed by Timothy Hatcher.
+
+        Some clients want to get highlights with the scroll applied,
+        others do not. Provide a CoordinateSpace param to be used for
+        getting a highlight (only used on iOS).
+
+        * WebCore.exp.in:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::getHighlight):
+        * inspector/InspectorController.h:
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::InspectorOverlay::getHighlight):
+        (WebCore::buildObjectForRendererFragments):
+        * inspector/InspectorOverlay.h:
+        (WebCore::Highlight::Highlight):
+        * testing/Internals.cpp:
+        (WebCore::Internals::inspectorHighlightRects):
+
</ins><span class="cx"> 2014-06-24  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [MSE][Mac] Uncaught exception when deallocating AVSampleBufferDisplayLayer
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -1785,7 +1785,7 @@
</span><span class="cx"> __ZNK7WebCore19HTMLOptGroupElement14groupLabelTextEv
</span><span class="cx"> __ZNK7WebCore19HTMLTextAreaElement5valueEv
</span><span class="cx"> __ZNK7WebCore19IDBDatabaseMetadata12isolatedCopyEv
</span><del>-__ZNK7WebCore19InspectorController12getHighlightEPNS_9HighlightE
</del><ins>+__ZNK7WebCore19InspectorController12getHighlightEPNS_9HighlightENS_16InspectorOverlay16CoordinateSystemE
</ins><span class="cx"> __ZNK7WebCore19InspectorController29buildObjectForHighlightedNodeEv
</span><span class="cx"> __ZNK7WebCore19MediaSessionManager30applicationWillEnterBackgroundEv
</span><span class="cx"> __ZNK7WebCore19MediaSessionManager30applicationWillEnterForegroundEv
</span><span class="lines">@@ -3152,7 +3152,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR) &amp;&amp; PLATFORM(IOS)
</span><span class="cx"> __ZN7WebCore16findIntersectionERKNS_10FloatPointES2_S2_S2_RS0_
</span><del>-__ZNK7WebCore19InspectorController12getHighlightEPNS_9HighlightE
</del><span class="cx"> __ZNK7WebCore9FloatQuad12containsQuadERKS0_
</span><span class="cx"> __ZNK7WebCore9FloatQuad13containsPointERKNS_10FloatPointE
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.cpp        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -318,9 +318,9 @@
</span><span class="cx">     m_overlay-&gt;paint(context);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorController::getHighlight(Highlight* highlight) const
</del><ins>+void InspectorController::getHighlight(Highlight* highlight, InspectorOverlay::CoordinateSystem coordinateSystem) const
</ins><span class="cx"> {
</span><del>-    m_overlay-&gt;getHighlight(highlight);
</del><ins>+    m_overlay-&gt;getHighlight(highlight, coordinateSystem);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;InspectorObject&gt; InspectorController::buildObjectForHighlightedNode() const
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebCore/inspector/InspectorController.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InspectorInstrumentationCookie.h&quot;
</span><ins>+#include &quot;InspectorOverlay.h&quot;
</ins><span class="cx"> #include &lt;inspector/InspectorAgentRegistry.h&gt;
</span><span class="cx"> #include &lt;inspector/InspectorEnvironment.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="lines">@@ -59,7 +60,6 @@
</span><span class="cx"> class InspectorDOMAgent;
</span><span class="cx"> class InspectorDOMDebuggerAgent;
</span><span class="cx"> class InspectorFrontendClient;
</span><del>-class InspectorOverlay;
</del><span class="cx"> class InspectorPageAgent;
</span><span class="cx"> class InspectorResourceAgent;
</span><span class="cx"> class InstrumentingAgents;
</span><span class="lines">@@ -67,7 +67,6 @@
</span><span class="cx"> class Page;
</span><span class="cx"> class PageDebuggerAgent;
</span><span class="cx"> class WebInjectedScriptManager;
</span><del>-struct Highlight;
</del><span class="cx"> 
</span><span class="cx"> class InspectorController final : public Inspector::InspectorEnvironment {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(InspectorController);
</span><span class="lines">@@ -104,7 +103,7 @@
</span><span class="cx"> 
</span><span class="cx">     void inspect(Node*);
</span><span class="cx">     void drawHighlight(GraphicsContext&amp;) const;
</span><del>-    void getHighlight(Highlight*) const;
</del><ins>+    void getHighlight(Highlight*, InspectorOverlay::CoordinateSystem) const;
</ins><span class="cx">     void hideHighlight();
</span><span class="cx">     Node* highlightedNode() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -100,17 +100,24 @@
</span><span class="cx">     context-&gt;fillPath(quadPath);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void contentsQuadToPage(const FrameView* mainView, const FrameView* view, FloatQuad&amp; quad)
</del><ins>+static void contentsQuadToCoordinateSystem(const FrameView* mainView, const FrameView* view, FloatQuad&amp; quad, InspectorOverlay::CoordinateSystem coordinateSystem)
</ins><span class="cx"> {
</span><span class="cx">     quad.setP1(view-&gt;contentsToRootView(roundedIntPoint(quad.p1())));
</span><span class="cx">     quad.setP2(view-&gt;contentsToRootView(roundedIntPoint(quad.p2())));
</span><span class="cx">     quad.setP3(view-&gt;contentsToRootView(roundedIntPoint(quad.p3())));
</span><span class="cx">     quad.setP4(view-&gt;contentsToRootView(roundedIntPoint(quad.p4())));
</span><del>-    quad += mainView-&gt;scrollOffset();
</del><ins>+
+    if (coordinateSystem == InspectorOverlay::CoordinateSystem::View)
+        quad += mainView-&gt;scrollOffset();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void buildRendererHighlight(RenderObject* renderer, RenderRegion* region, const HighlightConfig&amp; highlightConfig, Highlight* highlight)
</del><ins>+static void contentsQuadToPage(const FrameView* mainView, const FrameView* view, FloatQuad&amp; quad)
</ins><span class="cx"> {
</span><ins>+    contentsQuadToCoordinateSystem(mainView, view, quad, InspectorOverlay::CoordinateSystem::View);
+}
+
+static void buildRendererHighlight(RenderObject* renderer, RenderRegion* region, const HighlightConfig&amp; highlightConfig, Highlight* highlight, InspectorOverlay::CoordinateSystem coordinateSystem)
+{
</ins><span class="cx">     Frame* containingFrame = renderer-&gt;document().frame();
</span><span class="cx">     if (!containingFrame)
</span><span class="cx">         return;
</span><span class="lines">@@ -126,7 +133,7 @@
</span><span class="cx">         highlight-&gt;type = HighlightTypeRects;
</span><span class="cx">         renderer-&gt;absoluteQuads(highlight-&gt;quads);
</span><span class="cx">         for (size_t i = 0; i &lt; highlight-&gt;quads.size(); ++i)
</span><del>-            contentsQuadToPage(mainView, containingView, highlight-&gt;quads[i]);
</del><ins>+            contentsQuadToCoordinateSystem(mainView, containingView, highlight-&gt;quads[i], coordinateSystem);
</ins><span class="cx">     } else if (renderer-&gt;isBox() || renderer-&gt;isRenderInline()) {
</span><span class="cx">         LayoutRect contentBox;
</span><span class="cx">         LayoutRect paddingBox;
</span><span class="lines">@@ -202,10 +209,10 @@
</span><span class="cx">             absMarginQuad = renderer-&gt;localToAbsoluteQuad(FloatRect(marginBox));
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        contentsQuadToPage(mainView, containingView, absContentQuad);
-        contentsQuadToPage(mainView, containingView, absPaddingQuad);
-        contentsQuadToPage(mainView, containingView, absBorderQuad);
-        contentsQuadToPage(mainView, containingView, absMarginQuad);
</del><ins>+        contentsQuadToCoordinateSystem(mainView, containingView, absContentQuad, coordinateSystem);
+        contentsQuadToCoordinateSystem(mainView, containingView, absPaddingQuad, coordinateSystem);
+        contentsQuadToCoordinateSystem(mainView, containingView, absBorderQuad, coordinateSystem);
+        contentsQuadToCoordinateSystem(mainView, containingView, absMarginQuad, coordinateSystem);
</ins><span class="cx"> 
</span><span class="cx">         highlight-&gt;type = HighlightTypeNode;
</span><span class="cx">         highlight-&gt;quads.append(absMarginQuad);
</span><span class="lines">@@ -215,12 +222,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void buildNodeHighlight(Node* node, RenderRegion* region, const HighlightConfig&amp; highlightConfig, Highlight* highlight)
</del><ins>+static void buildNodeHighlight(Node* node, RenderRegion* region, const HighlightConfig&amp; highlightConfig, Highlight* highlight, InspectorOverlay::CoordinateSystem coordinateSystem)
</ins><span class="cx"> {
</span><span class="cx">     RenderObject* renderer = node-&gt;renderer();
</span><span class="cx">     if (!renderer)
</span><span class="cx">         return;
</span><del>-    buildRendererHighlight(renderer, region, highlightConfig, highlight);
</del><ins>+    buildRendererHighlight(renderer, region, highlightConfig, highlight, coordinateSystem);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void buildQuadHighlight(const FloatQuad&amp; quad, const HighlightConfig&amp; highlightConfig, Highlight *highlight)
</span><span class="lines">@@ -260,14 +267,14 @@
</span><span class="cx">     drawOutlinedQuad(context, outlineRect, Color(), color);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorOverlay::getHighlight(Highlight* highlight) const
</del><ins>+void InspectorOverlay::getHighlight(Highlight* highlight, InspectorOverlay::CoordinateSystem coordinateSystem) const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_highlightNode &amp;&amp; !m_highlightQuad)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     highlight-&gt;type = HighlightTypeRects;
</span><span class="cx">     if (m_highlightNode)
</span><del>-        buildNodeHighlight(m_highlightNode.get(), nullptr, m_nodeHighlightConfig, highlight);
</del><ins>+        buildNodeHighlight(m_highlightNode.get(), nullptr, m_nodeHighlightConfig, highlight, coordinateSystem);
</ins><span class="cx">     else
</span><span class="cx">         buildQuadHighlight(*m_highlightQuad, m_quadHighlightConfig, highlight);
</span><span class="cx"> }
</span><span class="lines">@@ -508,7 +515,7 @@
</span><span class="cx">     RenderFlowThread* containingFlowThread = renderer-&gt;flowThreadContainingBlock();
</span><span class="cx">     if (!containingFlowThread) {
</span><span class="cx">         Highlight highlight;
</span><del>-        buildRendererHighlight(renderer, nullptr, config, &amp;highlight);
</del><ins>+        buildRendererHighlight(renderer, nullptr, config, &amp;highlight, InspectorOverlay::CoordinateSystem::View);
</ins><span class="cx">         fragmentsArray-&gt;pushObject(buildObjectForHighlight(highlight));
</span><span class="cx">     } else {
</span><span class="cx">         RenderRegion* startRegion = nullptr;
</span><span class="lines">@@ -524,7 +531,7 @@
</span><span class="cx">             if (region-&gt;isValid()) {
</span><span class="cx">                 // Compute the highlight of the fragment inside the current region.
</span><span class="cx">                 Highlight highlight;
</span><del>-                buildRendererHighlight(renderer, region, config, &amp;highlight);
</del><ins>+                buildRendererHighlight(renderer, region, config, &amp;highlight, InspectorOverlay::CoordinateSystem::View);
</ins><span class="cx">                 RefPtr&lt;InspectorObject&gt; fragmentObject = buildObjectForHighlight(highlight);
</span><span class="cx"> 
</span><span class="cx">                 // Compute the clipping area of the region.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlayh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -70,6 +70,7 @@
</span><span class="cx"> struct Highlight {
</span><span class="cx">     Highlight()
</span><span class="cx">         : type(HighlightTypeNode)
</span><ins>+        , usePageCoordinates(true)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -102,10 +103,15 @@
</span><span class="cx">     InspectorOverlay(Page&amp;, InspectorClient*);
</span><span class="cx">     ~InspectorOverlay();
</span><span class="cx"> 
</span><ins>+    enum class CoordinateSystem {
+        View, // Adjusts for the main frame's scroll offset.
+        Document, // Does not adjust for the main frame's scroll offset.
+    };
+
</ins><span class="cx">     void update();
</span><span class="cx">     void paint(GraphicsContext&amp;);
</span><span class="cx">     void drawOutline(GraphicsContext*, const LayoutRect&amp;, const Color&amp;);
</span><del>-    void getHighlight(Highlight*) const;
</del><ins>+    void getHighlight(Highlight*, CoordinateSystem) const;
</ins><span class="cx"> 
</span><span class="cx">     void setPausedInDebuggerMessage(const String*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebCore/testing/Internals.cpp        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -717,7 +717,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Highlight highlight;
</span><del>-    document-&gt;page()-&gt;inspectorController().getHighlight(&amp;highlight);
</del><ins>+    document-&gt;page()-&gt;inspectorController().getHighlight(&amp;highlight, InspectorOverlay::CoordinateSystem::View);
</ins><span class="cx">     return ClientRectList::create(highlight.quads);
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(ec);
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx">         ?selectTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">         symbolWithPointer(?buildObjectForHighlightedNode@InspectorController@WebCore@@QBE?AV?$PassRefPtr@VInspectorObject@Inspector@@@WTF@@XZ, ?buildObjectForHighlightedNode@InspectorController@WebCore@@QEBA?AV?$PassRefPtr@VInspectorObject@Inspector@@@WTF@@XZ)
</span><del>-        symbolWithPointer(?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@@Z, ?getHighlight@InspectorController@WebCore@@QEBAXPEAUHighlight@2@@Z)
</del><ins>+        symbolWithPointer(?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@W4CoordinateSystem@InspectorOverlay@2@@Z, ?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@W4CoordinateSystem@InspectorOverlay@2@@Z)
</ins><span class="cx">         symbolWithPointer(?instrumentingAgentsForPage@InspectorInstrumentation@WebCore@@CAPAVInstrumentingAgents@2@PAVPage@2@@Z, ?instrumentingAgentsForPage@InspectorInstrumentation@WebCore@@CAPEAVInstrumentingAgents@2@PEAVPage@2@@Z)
</span><span class="cx">         ?s_frontendCounter@InspectorInstrumentation@WebCore@@0HA
</span><span class="cx">         symbolWithPointer(?isUnderTest@InspectorFrontendClientLocal@WebCore@@UAE_NXZ, ?isUnderTest@InspectorFrontendClientLocal@WebCore@@UEAA_NXZ)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-06-24  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        [iOS]: WK2 Inspector Node Highlighting
+        https://bugs.webkit.org/show_bug.cgi?id=134257
+
+        Reviewed by Timothy Hatcher.
+
+        * WebInspector/WebNodeHighlightView.mm:
+        (-[WebNodeHighlightView layoutSublayers:]):
+
</ins><span class="cx"> 2014-06-24  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Enable GAMEPAD in the Mac build, but disabled at runtime.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebInspectorWebNodeHighlightViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebInspector/WebNodeHighlightView.mm (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebInspector/WebNodeHighlightView.mm        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit/mac/WebInspector/WebNodeHighlightView.mm        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     Highlight h;
</span><del>-    [_webNodeHighlight inspectorController]-&gt;getHighlight(&amp;h);
</del><ins>+    [_webNodeHighlight inspectorController]-&gt;getHighlight(&amp;h, InspectorOverlay::CoordinateSystem::View);
</ins><span class="cx"> 
</span><span class="cx">     if (h.type == HighlightTypeNode)
</span><span class="cx">         [self _layoutForNodeHighlight:&amp;h parent:parentLayer];
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2014-06-24  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        [iOS]: WK2 Inspector Node Highlighting
+        https://bugs.webkit.org/show_bug.cgi?id=134257
+
+        Reviewed by Timothy Hatcher.
+
+        * Scripts/webkit2/messages.py:
+        (struct_or_class):
+        (headers_for_type):
+        * Shared/WebCoreArgumentCoders.h:
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;Highlight&gt;::encode):
+        (IPC::ArgumentCoder&lt;Highlight&gt;::decode):
+        Add a way to encode a WebCore::Highlight struct.
+
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _showInspectorHighlight:WebCore::]):
+        (-[WKWebView _hideInspectorHighlight]):
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::showInspectorHighlight):
+        (WebKit::PageClientImpl::hideInspectorHighlight):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::showInspectorHighlight):
+        (WebKit::WebPageProxy::hideInspectorHighlight):
+        * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
+        (WebKit::WebInspectorClient::highlight):
+        (WebKit::WebInspectorClient::hideHighlight):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::showInspectorHighlight):
+        (WebKit::WebPage::hideInspectorHighlight):
+        Send web process highlight / hideHighlight messages up to
+        the UIProcess so it can highlight in the WKContentView.
+        Pass up a WebCore::Highlight in Document coordinates.
+
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKInspectorHighlightView initWithFrame:]):
+        (-[WKInspectorHighlightView dealloc]):
+        (-[WKInspectorHighlightView _removeAllLayers]):
+        (-[WKInspectorHighlightView _createLayers:]):
+        (findIntersectionOnLineBetweenPoints):
+        (quadIntersection):
+        (layerPathWithHole):
+        (layerPath):
+        (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
+        (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
+        (-[WKInspectorHighlightView update:]):
+        Reuse the WebKit1 code to turn highlight float quads into CAShapeLayers.
+
+        (-[WKContentView _showInspectorHighlight:WebCore::]):
+        (-[WKContentView _hideInspectorHighlight]):
+        Show and hide the highlight view with the respective WebCore::Highlight.
+
</ins><span class="cx"> 2014-06-24  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Simplify decodeLegacySessionState
</span></span></pre></div>
<a id="trunkSourceWebKit2Scriptswebkit2messagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Scripts/webkit2/messages.py (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Scripts/webkit2/messages.py        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/Scripts/webkit2/messages.py        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -162,6 +162,7 @@
</span><span class="cx">         'WebCore::FloatPoint3D',
</span><span class="cx">         'WebCore::FileChooserSettings',
</span><span class="cx">         'WebCore::GrammarDetail',
</span><ins>+        'WebCore::Highlight',
</ins><span class="cx">         'WebCore::IDBDatabaseMetadata',
</span><span class="cx">         'WebCore::IDBGetResult',
</span><span class="cx">         'WebCore::IDBIndexMetadata',
</span><span class="lines">@@ -428,6 +429,7 @@
</span><span class="cx">         'WebCore::KeyframeValueList': ['&lt;WebCore/GraphicsLayer.h&gt;'],
</span><span class="cx">         'WebCore::KeypressCommand': ['&lt;WebCore/KeyboardEvent.h&gt;'],
</span><span class="cx">         'WebCore::FileChooserSettings': ['&lt;WebCore/FileChooser.h&gt;'],
</span><ins>+        'WebCore::Highlight': ['&lt;WebCore/InspectorOverlay.h&gt;'],
</ins><span class="cx">         'WebCore::PluginInfo': ['&lt;WebCore/PluginData.h&gt;'],
</span><span class="cx">         'WebCore::PasteboardImage': ['&lt;WebCore/Pasteboard.h&gt;'],
</span><span class="cx">         'WebCore::PasteboardWebContent': ['&lt;WebCore/Pasteboard.h&gt;'],
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include &lt;WebCore/FloatQuad.h&gt;
</span><ins>+#include &lt;WebCore/InspectorOverlay.h&gt;
</ins><span class="cx"> #include &lt;WebCore/Pasteboard.h&gt;
</span><span class="cx"> #include &lt;WebCore/SelectionRect.h&gt;
</span><span class="cx"> #include &lt;WebCore/SharedBuffer.h&gt;
</span><span class="lines">@@ -1196,6 +1197,42 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;Highlight&gt;::encode(ArgumentEncoder&amp; encoder, const Highlight&amp; highlight)
+{
+    encoder &lt;&lt; static_cast&lt;uint32_t&gt;(highlight.type);
+    encoder &lt;&lt; highlight.usePageCoordinates;
+    encoder &lt;&lt; highlight.contentColor;
+    encoder &lt;&lt; highlight.contentOutlineColor;
+    encoder &lt;&lt; highlight.paddingColor;
+    encoder &lt;&lt; highlight.borderColor;
+    encoder &lt;&lt; highlight.marginColor;
+    encoder &lt;&lt; highlight.quads;
+}
+
+bool ArgumentCoder&lt;Highlight&gt;::decode(ArgumentDecoder&amp; decoder, Highlight&amp; highlight)
+{
+    uint32_t type;
+    if (!decoder.decode(type))
+        return false;
+    highlight.type = (HighlightType)type;
+
+    if (!decoder.decode(highlight.usePageCoordinates))
+        return false;
+    if (!decoder.decode(highlight.contentColor))
+        return false;
+    if (!decoder.decode(highlight.contentOutlineColor))
+        return false;
+    if (!decoder.decode(highlight.paddingColor))
+        return false;
+    if (!decoder.decode(highlight.borderColor))
+        return false;
+    if (!decoder.decode(highlight.marginColor))
+        return false;
+    if (!decoder.decode(highlight.quads))
+        return false;
+    return true;
+}
+
</ins><span class="cx"> static void encodeSharedBuffer(ArgumentEncoder&amp; encoder, SharedBuffer* buffer)
</span><span class="cx"> {
</span><span class="cx">     SharedMemory::Handle handle;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -98,6 +98,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class FloatQuad;
</span><span class="cx"> class SelectionRect;
</span><ins>+struct Highlight;
</ins><span class="cx"> struct PasteboardImage;
</span><span class="cx"> struct PasteboardWebContent;
</span><span class="cx"> struct ViewportArguments;
</span><span class="lines">@@ -289,6 +290,11 @@
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::SelectionRect&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::Highlight&gt; {
+    static void encode(ArgumentEncoder&amp;, const WebCore::Highlight&amp;);
+    static bool decode(ArgumentDecoder&amp;, WebCore::Highlight&amp;);
+};
+
</ins><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::PasteboardWebContent&gt; {
</span><span class="cx">     static void encode(ArgumentEncoder&amp;, const WebCore::PasteboardWebContent&amp;);
</span><span class="cx">     static bool decode(ArgumentDecoder&amp;, WebCore::PasteboardWebContent&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -92,6 +92,7 @@
</span><span class="cx"> #import &lt;UIKit/UIWindow_Private.h&gt;
</span><span class="cx"> #import &lt;QuartzCore/CARenderServer.h&gt;
</span><span class="cx"> #import &lt;QuartzCore/QuartzCorePrivate.h&gt;
</span><ins>+#import &lt;WebCore/InspectorOverlay.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> @interface UIScrollView (UIScrollViewInternal)
</span><span class="cx"> - (void)_adjustForAutomaticKeyboardInfo:(NSDictionary*)info animated:(BOOL)animated lastAdjustment:(CGFloat*)lastAdjustment;
</span><span class="lines">@@ -639,6 +640,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_showInspectorHighlight:(const WebCore::Highlight&amp;)highlight
+{
+    [_contentView _showInspectorHighlight:highlight];
+}
+
+- (void)_hideInspectorHighlight
+{
+    [_contentView _hideInspectorHighlight];
+}
+
</ins><span class="cx"> static CGFloat contentZoomScale(WKWebView* webView)
</span><span class="cx"> {
</span><span class="cx">     UIView *zoomView;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -45,6 +45,10 @@
</span><span class="cx"> #define WK_WEB_VIEW_PROTOCOLS
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+namespace WebCore {
+struct Highlight;
+}
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> class WebPageProxy;
</span><span class="cx"> struct PrintInfo;
</span><span class="lines">@@ -89,6 +93,9 @@
</span><span class="cx"> - (void)_willInvokeUIScrollViewDelegateCallback;
</span><span class="cx"> - (void)_didInvokeUIScrollViewDelegateCallback;
</span><span class="cx"> 
</span><ins>+- (void)_showInspectorHighlight:(const WebCore::Highlight&amp;)highlight;
+- (void)_hideInspectorHighlight;
+
</ins><span class="cx"> - (void)_updateVisibleContentRects;
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, readonly) UIEdgeInsets _computedContentInset;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> class Cursor;
</span><span class="cx"> struct ViewportAttributes;
</span><ins>+struct Highlight;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -270,6 +271,9 @@
</span><span class="cx">     virtual void didFinishDrawingPagesToPDF(const IPC::DataReference&amp;) = 0;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+    virtual void showInspectorHighlight(const WebCore::Highlight&amp;) = 0;
+    virtual void hideInspectorHighlight() = 0;
+
</ins><span class="cx">     virtual void showInspectorIndication() = 0;
</span><span class="cx">     virtual void hideInspectorIndication() = 0;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -1207,6 +1207,9 @@
</span><span class="cx">     void stopAssistingNode();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+    void showInspectorHighlight(const WebCore::Highlight&amp;);
+    void hideInspectorHighlight();
+
</ins><span class="cx">     void showInspectorIndication();
</span><span class="cx">     void hideInspectorIndication();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -341,6 +341,9 @@
</span><span class="cx">     NotifyRevealedSelection()
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+    ShowInspectorHighlight(WebCore::Highlight highlight)
+    HideInspectorHighlight()
+
</ins><span class="cx">     ShowInspectorIndication()
</span><span class="cx">     HideInspectorIndication()
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -132,6 +132,9 @@
</span><span class="cx">     virtual WebCore::FloatSize contentsSize() const override;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+    virtual void showInspectorHighlight(const WebCore::Highlight&amp;) override;
+    virtual void hideInspectorHighlight() override;
+
</ins><span class="cx">     virtual void showInspectorIndication() override;
</span><span class="cx">     virtual void hideInspectorIndication() override;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -485,6 +485,16 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+void PageClientImpl::showInspectorHighlight(const WebCore::Highlight&amp; highlight)
+{
+    [m_webView _showInspectorHighlight:highlight];
+}
+
+void PageClientImpl::hideInspectorHighlight()
+{
+    [m_webView _hideInspectorHighlight];
+}
+
</ins><span class="cx"> void PageClientImpl::showInspectorIndication()
</span><span class="cx"> {
</span><span class="cx">     [m_webView _showInspectorIndication];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -33,6 +33,10 @@
</span><span class="cx"> @class WKContentView;
</span><span class="cx"> @class WKWebView;
</span><span class="cx"> 
</span><ins>+namespace WebCore {
+struct Highlight;
+}
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> class DrawingAreaProxy;
</span><span class="cx"> class FindIndicator;
</span><span class="lines">@@ -74,6 +78,9 @@
</span><span class="cx"> - (void)_didRelaunchProcess;
</span><span class="cx"> - (void)_setAcceleratedCompositingRootView:(UIView *)rootView;
</span><span class="cx"> 
</span><ins>+- (void)_showInspectorHighlight:(const WebCore::Highlight&amp;)highlight;
+- (void)_hideInspectorHighlight;
+
</ins><span class="cx"> - (void)_didCommitLoadForMainFrame;
</span><span class="cx"> - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&amp;)layerTreeTransaction;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -32,23 +32,27 @@
</span><span class="cx"> #import &quot;RemoteLayerTreeDrawingAreaProxy.h&quot;
</span><span class="cx"> #import &quot;RemoteScrollingCoordinatorProxy.h&quot;
</span><span class="cx"> #import &quot;SmartMagnificationController.h&quot;
</span><del>-#import &quot;WebKit2Initialize.h&quot;
</del><span class="cx"> #import &quot;WKBrowsingContextControllerInternal.h&quot;
</span><span class="cx"> #import &quot;WKBrowsingContextGroupPrivate.h&quot;
</span><span class="cx"> #import &quot;WKGeolocationProviderIOS.h&quot;
</span><span class="cx"> #import &quot;WKPreferencesInternal.h&quot;
</span><span class="cx"> #import &quot;WKProcessGroupPrivate.h&quot;
</span><span class="cx"> #import &quot;WKProcessPoolInternal.h&quot;
</span><ins>+#import &quot;WKWebViewConfiguration.h&quot;
</ins><span class="cx"> #import &quot;WKWebViewInternal.h&quot;
</span><del>-#import &quot;WKWebViewConfiguration.h&quot;
</del><span class="cx"> #import &quot;WebContext.h&quot;
</span><span class="cx"> #import &quot;WebFrameProxy.h&quot;
</span><ins>+#import &quot;WebKit2Initialize.h&quot;
+#import &quot;WebKitSystemInterfaceIOS.h&quot;
</ins><span class="cx"> #import &quot;WebPageGroup.h&quot;
</span><span class="cx"> #import &quot;WebSystemInterface.h&quot;
</span><del>-#import &quot;WebKitSystemInterfaceIOS.h&quot;
</del><ins>+#import &lt;CoreGraphics/CoreGraphics.h&gt;
+#import &lt;UIKit/UIWindow_Private.h&gt;
+#import &lt;WebCore/FloatQuad.h&gt;
</ins><span class="cx"> #import &lt;WebCore/FrameView.h&gt;
</span><ins>+#import &lt;WebCore/GeometryUtilities.h&gt;
+#import &lt;WebCore/InspectorOverlay.h&gt;
</ins><span class="cx"> #import &lt;WebCore/NotImplemented.h&gt;
</span><del>-#import &lt;UIKit/UIWindow_Private.h&gt;
</del><span class="cx"> #import &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -169,12 +173,252 @@
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+
+@interface WKInspectorHighlightView : UIView {
+    NSMutableArray *_layers; // CAShapeLayers.
+}
+- (void)update:(const WebCore::Highlight&amp;)highlight;
+@end
+
+@implementation WKInspectorHighlightView
+
+- (instancetype)initWithFrame:(CGRect)frame
+{
+    if (!(self = [super initWithFrame:frame]))
+        return nil;
+    _layers = [[NSMutableArray alloc] init];
+    return self;
+}
+
+- (void)dealloc
+{
+    [self _removeAllLayers];
+    [_layers release];
+    [super dealloc];
+}
+
+- (void)_removeAllLayers
+{
+    for (CAShapeLayer *layer in _layers)
+        [layer removeFromSuperlayer];
+    [_layers removeAllObjects];
+}
+
+- (void)_createLayers:(NSUInteger)numLayers
+{
+    if ([_layers count] == numLayers)
+        return;
+
+    [self _removeAllLayers];
+
+    for (NSUInteger i = 0; i &lt; numLayers; ++i) {
+        CAShapeLayer *layer = [[CAShapeLayer alloc] init];
+        [_layers addObject:layer];
+        [self.layer addSublayer:layer];
+        [layer release];
+    }
+}
+
+static bool findIntersectionOnLineBetweenPoints(const FloatPoint&amp; p1, const FloatPoint&amp; p2, const FloatPoint&amp; d1, const FloatPoint&amp; d2, FloatPoint&amp; intersection) 
+{
+    // Do the lines intersect?
+    FloatPoint temporaryIntersectionPoint;
+    if (!findIntersection(p1, p2, d1, d2, temporaryIntersectionPoint))
+        return false;
+
+    // Is the intersection between the two points on the line?
+    if (p1.x() &gt;= p2.x()) {
+        if (temporaryIntersectionPoint.x() &gt; p1.x() || temporaryIntersectionPoint.x() &lt; p2.x())
+            return false;
+    } else {
+        if (temporaryIntersectionPoint.x() &gt; p2.x() || temporaryIntersectionPoint.x() &lt; p1.x())
+            return false;
+    }
+    if (p1.y() &gt;= p2.y()) {
+        if (temporaryIntersectionPoint.y() &gt; p1.y() || temporaryIntersectionPoint.y() &lt; p2.y())
+            return false;
+    } else {
+        if (temporaryIntersectionPoint.y() &gt; p2.y() || temporaryIntersectionPoint.y() &lt; p1.y())
+            return false;
+    }
+
+    intersection = temporaryIntersectionPoint;
+    return true;
+}
+
+// This quad intersection works because the two quads are known to be at the same
+// rotation and clockwise-ness.
+static FloatQuad quadIntersection(FloatQuad bounds, FloatQuad toClamp)
+{
+    // Resulting points.
+    FloatPoint p1, p2, p3, p4;
+    bool containsPoint1 = false;
+    bool containsPoint2 = false;
+    bool containsPoint3 = false;
+    bool containsPoint4 = false;
+    bool intersectForPoint1 = false;
+    bool intersectForPoint2 = false;
+    bool intersectForPoint3 = false;
+    bool intersectForPoint4 = false;
+
+    // Top / bottom vertical clamping.
+    if (bounds.containsPoint(toClamp.p1())) {
+        containsPoint1 = true;
+        p1 = toClamp.p1();
+    } else if (!(intersectForPoint1 = findIntersectionOnLineBetweenPoints(bounds.p1(), bounds.p2(), toClamp.p1(), toClamp.p4(), p1)))
+        p1 = toClamp.p1();
+
+    if (bounds.containsPoint(toClamp.p2())) {
+        containsPoint2 = true;
+        p2 = toClamp.p2();
+    } else if (!(intersectForPoint2 = findIntersectionOnLineBetweenPoints(bounds.p1(), bounds.p2(), toClamp.p2(), toClamp.p3(), p2)))
+        p2 = toClamp.p2();
+
+    if (bounds.containsPoint(toClamp.p3())) {
+        containsPoint3 = true;
+        p3 = toClamp.p3();
+    } else if (!(intersectForPoint3 = findIntersectionOnLineBetweenPoints(bounds.p4(), bounds.p3(), toClamp.p2(), toClamp.p3(), p3)))
+        p3 = toClamp.p3();
+
+    if (bounds.containsPoint(toClamp.p4())) {
+        containsPoint4 = true;
+        p4 = toClamp.p4();
+    } else if (!(intersectForPoint4 = findIntersectionOnLineBetweenPoints(bounds.p4(), bounds.p3(), toClamp.p1(), toClamp.p4(), p4)))
+        p4 = toClamp.p4();
+
+    // If only one of the points intersected on either the top or bottom line then we
+    // can clamp the other point on that line to the corner of the bounds.
+    if (!containsPoint1 &amp;&amp; intersectForPoint2 &amp;&amp; !intersectForPoint1) {
+        containsPoint1 = true;
+        p1 = bounds.p1();
+    } else if (!containsPoint2 &amp;&amp; intersectForPoint1 &amp;&amp; !intersectForPoint2) {
+        containsPoint2 = true;
+        p2 = bounds.p2();
+    }
+    if (!containsPoint4 &amp;&amp; intersectForPoint3 &amp;&amp; !intersectForPoint4) {
+        containsPoint4 = true;
+        p4 = bounds.p4();
+    } else if (!containsPoint3 &amp;&amp; intersectForPoint4 &amp;&amp; !intersectForPoint3) {
+        containsPoint3 = true;
+        p3 = bounds.p3();
+    }
+
+    // Now we only need to perform horizontal clamping for unadjusted points.
+    if (!containsPoint2 &amp;&amp; !intersectForPoint2)
+        findIntersectionOnLineBetweenPoints(bounds.p2(), bounds.p3(), p1, p2, p2);
+    if (!containsPoint3 &amp;&amp; !intersectForPoint3)
+        findIntersectionOnLineBetweenPoints(bounds.p2(), bounds.p3(), p4, p3, p3);
+    if (!containsPoint1 &amp;&amp; !intersectForPoint1)
+        findIntersectionOnLineBetweenPoints(bounds.p1(), bounds.p4(), p1, p2, p1);
+    if (!containsPoint4 &amp;&amp; !intersectForPoint4)
+        findIntersectionOnLineBetweenPoints(bounds.p1(), bounds.p4(), p4, p3, p4);
+
+    return FloatQuad(p1, p2, p3, p4);
+}
+
+static void layerPathWithHole(CAShapeLayer *layer, const FloatQuad&amp; outerQuad, const FloatQuad&amp; holeQuad)
+{
+    // Nothing to show.
+    if (outerQuad == holeQuad || holeQuad.containsQuad(outerQuad)) {
+        layer.path = NULL;
+        return;
+    }
+
+    // If there is a negative margin / padding then the outer box might not
+    // fully contain the hole box. In such cases we recalculate the hole to
+    // be the intersection of the two quads.
+    FloatQuad innerHole;
+    if (outerQuad.containsQuad(holeQuad))
+        innerHole = holeQuad;
+    else
+        innerHole = quadIntersection(outerQuad, holeQuad);
+
+    // Clockwise inside rect (hole), Counter-Clockwise outside rect (fill).
+    CGMutablePathRef path = CGPathCreateMutable();
+    CGPathMoveToPoint(path, 0, innerHole.p1().x(), innerHole.p1().y());
+    CGPathAddLineToPoint(path, 0, innerHole.p2().x(), innerHole.p2().y());
+    CGPathAddLineToPoint(path, 0, innerHole.p3().x(), innerHole.p3().y());
+    CGPathAddLineToPoint(path, 0, innerHole.p4().x(), innerHole.p4().y());
+    CGPathMoveToPoint(path, 0, outerQuad.p1().x(), outerQuad.p1().y());
+    CGPathAddLineToPoint(path, 0, outerQuad.p4().x(), outerQuad.p4().y());
+    CGPathAddLineToPoint(path, 0, outerQuad.p3().x(), outerQuad.p3().y());
+    CGPathAddLineToPoint(path, 0, outerQuad.p2().x(), outerQuad.p2().y());
+    layer.path = path;
+    CGPathRelease(path);
+}
+
+static void layerPath(CAShapeLayer *layer, const FloatQuad&amp; outerQuad)
+{
+    CGMutablePathRef path = CGPathCreateMutable();
+    CGPathMoveToPoint(path, 0, outerQuad.p1().x(), outerQuad.p1().y());
+    CGPathAddLineToPoint(path, 0, outerQuad.p4().x(), outerQuad.p4().y());
+    CGPathAddLineToPoint(path, 0, outerQuad.p3().x(), outerQuad.p3().y());
+    CGPathAddLineToPoint(path, 0, outerQuad.p2().x(), outerQuad.p2().y());
+    layer.path = path;
+    CGPathRelease(path);
+}
+
+- (void)_layoutForNodeHighlight:(const Highlight&amp;)highlight
+{
+    [self _createLayers:4];
+
+    CAShapeLayer *marginLayer = [_layers objectAtIndex:0];
+    CAShapeLayer *borderLayer = [_layers objectAtIndex:1];
+    CAShapeLayer *paddingLayer = [_layers objectAtIndex:2];
+    CAShapeLayer *contentLayer = [_layers objectAtIndex:3];
+
+    FloatQuad marginQuad = highlight.quads[0];
+    FloatQuad borderQuad = highlight.quads[1];
+    FloatQuad paddingQuad = highlight.quads[2];
+    FloatQuad contentQuad = highlight.quads[3];
+
+    marginLayer.fillColor = cachedCGColor(highlight.marginColor, ColorSpaceDeviceRGB);
+    borderLayer.fillColor = cachedCGColor(highlight.borderColor, ColorSpaceDeviceRGB);
+    paddingLayer.fillColor = cachedCGColor(highlight.paddingColor, ColorSpaceDeviceRGB);
+    contentLayer.fillColor = cachedCGColor(highlight.contentColor, ColorSpaceDeviceRGB);
+
+    layerPathWithHole(marginLayer, marginQuad, borderQuad);
+    layerPathWithHole(borderLayer, borderQuad, paddingQuad);
+    layerPathWithHole(paddingLayer, paddingQuad, contentQuad);
+    layerPath(contentLayer, contentQuad);
+}
+
+- (void)_layoutForRectsHighlight:(const Highlight&amp;)highlight
+{
+    NSUInteger numLayers = (NSUInteger)highlight.quads.size();
+    if (!numLayers) {
+        [self _removeAllLayers];
+        return;
+    }
+
+    [self _createLayers:numLayers];
+
+    CGColorRef contentColor = cachedCGColor(highlight.contentColor, ColorSpaceDeviceRGB);
+    for (NSUInteger i = 0; i &lt; numLayers; ++i) {
+        CAShapeLayer *layer = [_layers objectAtIndex:i];
+        layer.fillColor = contentColor;
+        layerPath(layer, highlight.quads[i]);
+    }
+}
+
+- (void)update:(const Highlight&amp;)highlight
+{
+    if (highlight.type == HighlightTypeNode)
+        [self _layoutForNodeHighlight:highlight];
+    else if (highlight.type == HighlightTypeRects)
+        [self _layoutForRectsHighlight:highlight];
+}
+
+@end
+
+
</ins><span class="cx"> @implementation WKContentView {
</span><span class="cx">     std::unique_ptr&lt;PageClientImpl&gt; _pageClient;
</span><span class="cx">     RetainPtr&lt;WKBrowsingContextController&gt; _browsingContextController;
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;UIView&gt; _rootContentView;
</span><span class="cx">     RetainPtr&lt;WKInspectorIndicationView&gt; _inspectorIndicationView;
</span><ins>+    RetainPtr&lt;WKInspectorHighlightView&gt; _inspectorHighlightView;
</ins><span class="cx"> 
</span><span class="cx">     HistoricalVelocityData _historicalKinematicData;
</span><span class="cx"> }
</span><span class="lines">@@ -271,6 +515,24 @@
</span><span class="cx">     return [self isEditable];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_showInspectorHighlight:(const WebCore::Highlight&amp;)highlight
+{
+    if (!_inspectorHighlightView) {
+        _inspectorHighlightView = adoptNS([[WKInspectorHighlightView alloc] initWithFrame:CGRectZero]);
+        [self insertSubview:_inspectorHighlightView.get() aboveSubview:_rootContentView.get()];
+    }
+
+    [_inspectorHighlightView update:highlight];
+}
+
+- (void)_hideInspectorHighlight
+{
+    if (_inspectorHighlightView) {
+        [_inspectorHighlightView removeFromSuperview];
+        _inspectorHighlightView = nil;
+    }
+}
+
</ins><span class="cx"> - (BOOL)isShowingInspectorIndication
</span><span class="cx"> {
</span><span class="cx">     return !!_inspectorIndicationView;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -646,6 +646,16 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+void WebPageProxy::showInspectorHighlight(const WebCore::Highlight&amp; highlight)
+{
+    m_pageClient.showInspectorHighlight(highlight);
+}
+
+void WebPageProxy::hideInspectorHighlight()
+{
+    m_pageClient.hideInspectorHighlight();
+}
+
</ins><span class="cx"> void WebPageProxy::showInspectorIndication()
</span><span class="cx"> {
</span><span class="cx">     m_pageClient.showInspectorIndication();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebInspectorClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebInspectorClient.cpp        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -33,6 +33,10 @@
</span><span class="cx"> #include &lt;WebCore/InspectorController.h&gt;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &lt;WebCore/InspectorOverlay.h&gt;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -69,6 +73,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebInspectorClient::highlight()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (!m_highlightOverlay) {
</span><span class="cx">         RefPtr&lt;PageOverlay&gt; highlightOverlay = PageOverlay::create(this);
</span><span class="cx">         m_highlightOverlay = highlightOverlay.get();
</span><span class="lines">@@ -78,12 +83,21 @@
</span><span class="cx">         m_highlightOverlay-&gt;stopFadeOutAnimation();
</span><span class="cx">         m_highlightOverlay-&gt;setNeedsDisplay();
</span><span class="cx">     }
</span><ins>+#else
+    Highlight highlight;
+    m_page-&gt;corePage()-&gt;inspectorController().getHighlight(&amp;highlight, InspectorOverlay::CoordinateSystem::Document);
+    m_page-&gt;showInspectorHighlight(highlight);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebInspectorClient::hideHighlight()
</span><span class="cx"> {
</span><ins>+#if !PLATFORM(IOS)
</ins><span class="cx">     if (m_highlightOverlay)
</span><span class="cx">         m_page-&gt;uninstallPageOverlay(m_highlightOverlay, PageOverlay::FadeMode::Fade);
</span><ins>+#else
+    m_page-&gt;hideInspectorHighlight();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx"> class TextCheckingRequest;
</span><span class="cx"> class URL;
</span><span class="cx"> class VisibleSelection;
</span><ins>+struct Highlight;
</ins><span class="cx"> struct KeypressCommand;
</span><span class="cx"> struct TextCheckingResult;
</span><span class="cx"> }
</span><span class="lines">@@ -507,6 +508,9 @@
</span><span class="cx">     void dispatchAsynchronousTouchEvents(const Vector&lt;WebTouchEvent, 1&gt;&amp; queue);
</span><span class="cx">     void contentSizeCategoryDidChange(const String&amp;);
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+    void showInspectorHighlight(const WebCore::Highlight&amp;);
+    void hideInspectorHighlight();
+
</ins><span class="cx">     void showInspectorIndication();
</span><span class="cx">     void hideInspectorIndication();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (170405 => 170406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-06-24 23:39:15 UTC (rev 170405)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-06-24 23:50:07 UTC (rev 170406)
</span><span class="lines">@@ -612,6 +612,16 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+void WebPage::showInspectorHighlight(const WebCore::Highlight&amp; highlight)
+{
+    send(Messages::WebPageProxy::ShowInspectorHighlight(highlight));
+}
+
+void WebPage::hideInspectorHighlight()
+{
+    send(Messages::WebPageProxy::HideInspectorHighlight());
+}
+
</ins><span class="cx"> void WebPage::showInspectorIndication()
</span><span class="cx"> {
</span><span class="cx">     send(Messages::WebPageProxy::ShowInspectorIndication());
</span></span></pre>
</div>
</div>

</body>
</html>