<!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 <pecoraro@apple.com> 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<Highlight>::encode):
(IPC::ArgumentCoder<Highlight>::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 <pecoraro@apple.com>
+
+ [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 <jer.noble@apple.com>
</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) && 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->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->getHighlight(highlight);
</del><ins>+ m_overlay->getHighlight(highlight, coordinateSystem);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PassRefPtr<InspectorObject> 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 "InspectorInstrumentationCookie.h"
</span><ins>+#include "InspectorOverlay.h"
</ins><span class="cx"> #include <inspector/InspectorAgentRegistry.h>
</span><span class="cx"> #include <inspector/InspectorEnvironment.h>
</span><span class="cx"> #include <wtf/Forward.h>
</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&) 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->fillPath(quadPath);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void contentsQuadToPage(const FrameView* mainView, const FrameView* view, FloatQuad& quad)
</del><ins>+static void contentsQuadToCoordinateSystem(const FrameView* mainView, const FrameView* view, FloatQuad& quad, InspectorOverlay::CoordinateSystem coordinateSystem)
</ins><span class="cx"> {
</span><span class="cx"> quad.setP1(view->contentsToRootView(roundedIntPoint(quad.p1())));
</span><span class="cx"> quad.setP2(view->contentsToRootView(roundedIntPoint(quad.p2())));
</span><span class="cx"> quad.setP3(view->contentsToRootView(roundedIntPoint(quad.p3())));
</span><span class="cx"> quad.setP4(view->contentsToRootView(roundedIntPoint(quad.p4())));
</span><del>- quad += mainView->scrollOffset();
</del><ins>+
+ if (coordinateSystem == InspectorOverlay::CoordinateSystem::View)
+ quad += mainView->scrollOffset();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static void buildRendererHighlight(RenderObject* renderer, RenderRegion* region, const HighlightConfig& highlightConfig, Highlight* highlight)
</del><ins>+static void contentsQuadToPage(const FrameView* mainView, const FrameView* view, FloatQuad& quad)
</ins><span class="cx"> {
</span><ins>+ contentsQuadToCoordinateSystem(mainView, view, quad, InspectorOverlay::CoordinateSystem::View);
+}
+
+static void buildRendererHighlight(RenderObject* renderer, RenderRegion* region, const HighlightConfig& highlightConfig, Highlight* highlight, InspectorOverlay::CoordinateSystem coordinateSystem)
+{
</ins><span class="cx"> Frame* containingFrame = renderer->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->type = HighlightTypeRects;
</span><span class="cx"> renderer->absoluteQuads(highlight->quads);
</span><span class="cx"> for (size_t i = 0; i < highlight->quads.size(); ++i)
</span><del>- contentsQuadToPage(mainView, containingView, highlight->quads[i]);
</del><ins>+ contentsQuadToCoordinateSystem(mainView, containingView, highlight->quads[i], coordinateSystem);
</ins><span class="cx"> } else if (renderer->isBox() || renderer->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->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->type = HighlightTypeNode;
</span><span class="cx"> highlight->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& highlightConfig, Highlight* highlight)
</del><ins>+static void buildNodeHighlight(Node* node, RenderRegion* region, const HighlightConfig& highlightConfig, Highlight* highlight, InspectorOverlay::CoordinateSystem coordinateSystem)
</ins><span class="cx"> {
</span><span class="cx"> RenderObject* renderer = node->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& quad, const HighlightConfig& 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 && !m_highlightQuad)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> highlight->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->flowThreadContainingBlock();
</span><span class="cx"> if (!containingFlowThread) {
</span><span class="cx"> Highlight highlight;
</span><del>- buildRendererHighlight(renderer, nullptr, config, &highlight);
</del><ins>+ buildRendererHighlight(renderer, nullptr, config, &highlight, InspectorOverlay::CoordinateSystem::View);
</ins><span class="cx"> fragmentsArray->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->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, &highlight);
</del><ins>+ buildRendererHighlight(renderer, region, config, &highlight, InspectorOverlay::CoordinateSystem::View);
</ins><span class="cx"> RefPtr<InspectorObject> 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&, 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&);
</span><span class="cx"> void drawOutline(GraphicsContext*, const LayoutRect&, const Color&);
</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->page()->inspectorController().getHighlight(&highlight);
</del><ins>+ document->page()->inspectorController().getHighlight(&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 <pecoraro@apple.com>
+
+ [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 <beidson@apple.com>
</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]->getHighlight(&h);
</del><ins>+ [_webNodeHighlight inspectorController]->getHighlight(&h, InspectorOverlay::CoordinateSystem::View);
</ins><span class="cx">
</span><span class="cx"> if (h.type == HighlightTypeNode)
</span><span class="cx"> [self _layoutForNodeHighlight:&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 <pecoraro@apple.com>
+
+ [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<Highlight>::encode):
+ (IPC::ArgumentCoder<Highlight>::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 <andersca@apple.com>
</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': ['<WebCore/GraphicsLayer.h>'],
</span><span class="cx"> 'WebCore::KeypressCommand': ['<WebCore/KeyboardEvent.h>'],
</span><span class="cx"> 'WebCore::FileChooserSettings': ['<WebCore/FileChooser.h>'],
</span><ins>+ 'WebCore::Highlight': ['<WebCore/InspectorOverlay.h>'],
</ins><span class="cx"> 'WebCore::PluginInfo': ['<WebCore/PluginData.h>'],
</span><span class="cx"> 'WebCore::PasteboardImage': ['<WebCore/Pasteboard.h>'],
</span><span class="cx"> 'WebCore::PasteboardWebContent': ['<WebCore/Pasteboard.h>'],
</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 <WebCore/FloatQuad.h>
</span><ins>+#include <WebCore/InspectorOverlay.h>
</ins><span class="cx"> #include <WebCore/Pasteboard.h>
</span><span class="cx"> #include <WebCore/SelectionRect.h>
</span><span class="cx"> #include <WebCore/SharedBuffer.h>
</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<Highlight>::encode(ArgumentEncoder& encoder, const Highlight& highlight)
+{
+ encoder << static_cast<uint32_t>(highlight.type);
+ encoder << highlight.usePageCoordinates;
+ encoder << highlight.contentColor;
+ encoder << highlight.contentOutlineColor;
+ encoder << highlight.paddingColor;
+ encoder << highlight.borderColor;
+ encoder << highlight.marginColor;
+ encoder << highlight.quads;
+}
+
+bool ArgumentCoder<Highlight>::decode(ArgumentDecoder& decoder, Highlight& 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& 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&, WebCore::SelectionRect&);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<> struct ArgumentCoder<WebCore::Highlight> {
+ static void encode(ArgumentEncoder&, const WebCore::Highlight&);
+ static bool decode(ArgumentDecoder&, WebCore::Highlight&);
+};
+
</ins><span class="cx"> template<> struct ArgumentCoder<WebCore::PasteboardWebContent> {
</span><span class="cx"> static void encode(ArgumentEncoder&, const WebCore::PasteboardWebContent&);
</span><span class="cx"> static bool decode(ArgumentDecoder&, WebCore::PasteboardWebContent&);
</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 <UIKit/UIWindow_Private.h>
</span><span class="cx"> #import <QuartzCore/CARenderServer.h>
</span><span class="cx"> #import <QuartzCore/QuartzCorePrivate.h>
</span><ins>+#import <WebCore/InspectorOverlay.h>
</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&)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&)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&) = 0;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+ virtual void showInspectorHighlight(const WebCore::Highlight&) = 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&);
+ 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&) 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& 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&)highlight;
+- (void)_hideInspectorHighlight;
+
</ins><span class="cx"> - (void)_didCommitLoadForMainFrame;
</span><span class="cx"> - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)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 "RemoteLayerTreeDrawingAreaProxy.h"
</span><span class="cx"> #import "RemoteScrollingCoordinatorProxy.h"
</span><span class="cx"> #import "SmartMagnificationController.h"
</span><del>-#import "WebKit2Initialize.h"
</del><span class="cx"> #import "WKBrowsingContextControllerInternal.h"
</span><span class="cx"> #import "WKBrowsingContextGroupPrivate.h"
</span><span class="cx"> #import "WKGeolocationProviderIOS.h"
</span><span class="cx"> #import "WKPreferencesInternal.h"
</span><span class="cx"> #import "WKProcessGroupPrivate.h"
</span><span class="cx"> #import "WKProcessPoolInternal.h"
</span><ins>+#import "WKWebViewConfiguration.h"
</ins><span class="cx"> #import "WKWebViewInternal.h"
</span><del>-#import "WKWebViewConfiguration.h"
</del><span class="cx"> #import "WebContext.h"
</span><span class="cx"> #import "WebFrameProxy.h"
</span><ins>+#import "WebKit2Initialize.h"
+#import "WebKitSystemInterfaceIOS.h"
</ins><span class="cx"> #import "WebPageGroup.h"
</span><span class="cx"> #import "WebSystemInterface.h"
</span><del>-#import "WebKitSystemInterfaceIOS.h"
</del><ins>+#import <CoreGraphics/CoreGraphics.h>
+#import <UIKit/UIWindow_Private.h>
+#import <WebCore/FloatQuad.h>
</ins><span class="cx"> #import <WebCore/FrameView.h>
</span><ins>+#import <WebCore/GeometryUtilities.h>
+#import <WebCore/InspectorOverlay.h>
</ins><span class="cx"> #import <WebCore/NotImplemented.h>
</span><del>-#import <UIKit/UIWindow_Private.h>
</del><span class="cx"> #import <wtf/CurrentTime.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</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&)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 < numLayers; ++i) {
+ CAShapeLayer *layer = [[CAShapeLayer alloc] init];
+ [_layers addObject:layer];
+ [self.layer addSublayer:layer];
+ [layer release];
+ }
+}
+
+static bool findIntersectionOnLineBetweenPoints(const FloatPoint& p1, const FloatPoint& p2, const FloatPoint& d1, const FloatPoint& d2, FloatPoint& 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() >= p2.x()) {
+ if (temporaryIntersectionPoint.x() > p1.x() || temporaryIntersectionPoint.x() < p2.x())
+ return false;
+ } else {
+ if (temporaryIntersectionPoint.x() > p2.x() || temporaryIntersectionPoint.x() < p1.x())
+ return false;
+ }
+ if (p1.y() >= p2.y()) {
+ if (temporaryIntersectionPoint.y() > p1.y() || temporaryIntersectionPoint.y() < p2.y())
+ return false;
+ } else {
+ if (temporaryIntersectionPoint.y() > p2.y() || temporaryIntersectionPoint.y() < 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 && intersectForPoint2 && !intersectForPoint1) {
+ containsPoint1 = true;
+ p1 = bounds.p1();
+ } else if (!containsPoint2 && intersectForPoint1 && !intersectForPoint2) {
+ containsPoint2 = true;
+ p2 = bounds.p2();
+ }
+ if (!containsPoint4 && intersectForPoint3 && !intersectForPoint4) {
+ containsPoint4 = true;
+ p4 = bounds.p4();
+ } else if (!containsPoint3 && intersectForPoint4 && !intersectForPoint3) {
+ containsPoint3 = true;
+ p3 = bounds.p3();
+ }
+
+ // Now we only need to perform horizontal clamping for unadjusted points.
+ if (!containsPoint2 && !intersectForPoint2)
+ findIntersectionOnLineBetweenPoints(bounds.p2(), bounds.p3(), p1, p2, p2);
+ if (!containsPoint3 && !intersectForPoint3)
+ findIntersectionOnLineBetweenPoints(bounds.p2(), bounds.p3(), p4, p3, p3);
+ if (!containsPoint1 && !intersectForPoint1)
+ findIntersectionOnLineBetweenPoints(bounds.p1(), bounds.p4(), p1, p2, p1);
+ if (!containsPoint4 && !intersectForPoint4)
+ findIntersectionOnLineBetweenPoints(bounds.p1(), bounds.p4(), p4, p3, p4);
+
+ return FloatQuad(p1, p2, p3, p4);
+}
+
+static void layerPathWithHole(CAShapeLayer *layer, const FloatQuad& outerQuad, const FloatQuad& 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& 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&)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&)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 < numLayers; ++i) {
+ CAShapeLayer *layer = [_layers objectAtIndex:i];
+ layer.fillColor = contentColor;
+ layerPath(layer, highlight.quads[i]);
+ }
+}
+
+- (void)update:(const Highlight&)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<PageClientImpl> _pageClient;
</span><span class="cx"> RetainPtr<WKBrowsingContextController> _browsingContextController;
</span><span class="cx">
</span><span class="cx"> RetainPtr<UIView> _rootContentView;
</span><span class="cx"> RetainPtr<WKInspectorIndicationView> _inspectorIndicationView;
</span><ins>+ RetainPtr<WKInspectorHighlightView> _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&)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& 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 <WebCore/InspectorController.h>
</span><span class="cx"> #include <WebCore/Page.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(IOS)
+#include <WebCore/InspectorOverlay.h>
+#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<PageOverlay> 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->stopFadeOutAnimation();
</span><span class="cx"> m_highlightOverlay->setNeedsDisplay();
</span><span class="cx"> }
</span><ins>+#else
+ Highlight highlight;
+ m_page->corePage()->inspectorController().getHighlight(&highlight, InspectorOverlay::CoordinateSystem::Document);
+ m_page->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->uninstallPageOverlay(m_highlightOverlay, PageOverlay::FadeMode::Fade);
</span><ins>+#else
+ m_page->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<WebTouchEvent, 1>& queue);
</span><span class="cx"> void contentSizeCategoryDidChange(const String&);
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+ void showInspectorHighlight(const WebCore::Highlight&);
+ 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& 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>