<!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>[168339] 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/168339">168339</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2014-05-05 18:14:02 -0700 (Mon, 05 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS][WK2] Prefetch DNS hostnames on tap highlight
https://bugs.webkit.org/show_bug.cgi?id=132509

Patch by Benjamin Poulain &lt;bpoulain@apple.com&gt; on 2014-05-05
Reviewed by Alexey Proskuryakov.


Source/WebCore: 
* WebCore.exp.in:
* dom/Element.cpp:
* dom/Element.h:
(WebCore::Element::absoluteLinkURL()):

Source/WebKit2: 
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::tapHighlightAtPosition):</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="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCorerenderingHitTestResultcpp">trunk/Source/WebCore/rendering/HitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</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 (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebCore/ChangeLog        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-05-05  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Prefetch DNS hostnames on tap highlight
+        https://bugs.webkit.org/show_bug.cgi?id=132509
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebCore.exp.in:
+        * dom/Element.cpp:
+        * dom/Element.h:
+        (WebCore::Element::absoluteLinkURL()):
+
</ins><span class="cx"> 2014-05-05  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -2457,6 +2457,7 @@
</span><span class="cx"> __ZN7WebCore11MemoryCache18pruneDeadResourcesEv
</span><span class="cx"> __ZN7WebCore11MemoryCache18pruneLiveResourcesEb
</span><span class="cx"> __ZN7WebCore11isEndOfLineERKNS_15VisiblePositionE
</span><ins>+__ZN7WebCore11prefetchDNSERKN3WTF6StringE
</ins><span class="cx"> __ZN7WebCore12AudioSession11setCategoryENS0_12CategoryTypeE
</span><span class="cx"> __ZN7WebCore12AudioSession13sharedSessionEv
</span><span class="cx"> __ZN7WebCore12EventHandler10mouseMovedEP8WebEvent
</span><span class="lines">@@ -2658,6 +2659,7 @@
</span><span class="cx"> __ZN7WebCore9FrameView35setUseCustomFixedPositionLayoutRectEb
</span><span class="cx"> __ZN7WebCore9FrameView36scheduleLayerFlushAllowingThrottlingEv
</span><span class="cx"> __ZN7WebCore9PageGroup17removeVisitedLinkERKNS_3URLE
</span><ins>+__ZNK7WebCore7Element15absoluteLinkURLEv
</ins><span class="cx"> __ZNK7WebCore9FrameView17wasScrolledByUserEv
</span><span class="cx"> __ZNK7WebCore10FloatPointcv7CGPointEv
</span><span class="cx"> __ZNK7WebCore10ScrollView21unobscuredContentRectENS_14ScrollableArea36VisibleContentRectIncludesScrollbarsE
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -4634,7 +4634,7 @@
</span><span class="cx">                 B2E4EC970D00C22B00432643 /* SVGZoomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2E4EC940D00C22B00432643 /* SVGZoomEvent.cpp */; };
</span><span class="cx">                 B2E4EC980D00C22B00432643 /* SVGZoomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E4EC950D00C22B00432643 /* SVGZoomEvent.h */; };
</span><span class="cx">                 B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */; };
</span><del>-                B2F34FE60E82F81400F627CD /* DNS.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F34FE50E82F81400F627CD /* DNS.h */; };
</del><ins>+                B2F34FE60E82F81400F627CD /* DNS.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F34FE50E82F81400F627CD /* DNS.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */; };
</span><span class="cx">                 B2FA3D360AB75A6F000E5AC4 /* JSSVGAnimateColorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */; };
</span><span class="cx">                 B2FA3D370AB75A6F000E5AC4 /* JSSVGAnimateColorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */; };
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -77,6 +77,7 @@
</span><span class="cx"> #include &quot;TextIterator.h&quot;
</span><span class="cx"> #include &quot;VoidCallback.h&quot;
</span><span class="cx"> #include &quot;WheelEvent.h&quot;
</span><ins>+#include &quot;XLinkNames.h&quot;
</ins><span class="cx"> #include &quot;XMLNSNames.h&quot;
</span><span class="cx"> #include &quot;XMLNames.h&quot;
</span><span class="cx"> #include &quot;htmlediting.h&quot;
</span><span class="lines">@@ -1168,6 +1169,23 @@
</span><span class="cx">         setNeedsStyleRecalc();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+URL Element::absoluteLinkURL() const
+{
+    if (!isLink())
+        return URL();
+
+    AtomicString linkAttribute;
+    if (hasTagName(SVGNames::aTag))
+        linkAttribute = getAttribute(XLinkNames::hrefAttr);
+    else
+        linkAttribute = getAttribute(HTMLNames::hrefAttr);
+
+    if (linkAttribute.isEmpty())
+        return URL();
+
+    return document().completeURL(stripLeadingAndTrailingHTMLSpaces(linkAttribute));
+}
+
</ins><span class="cx"> // Returns true is the given attribute is an event handler.
</span><span class="cx"> // We consider an event handler any attribute that begins with &quot;on&quot;.
</span><span class="cx"> // It is a simple solution that has the advantage of not requiring any
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebCore/dom/Element.h        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -566,6 +566,8 @@
</span><span class="cx">     void clearStyleDerivedDataBeforeDetachingRenderer();
</span><span class="cx">     void clearHoverAndActiveStatusBeforeDetachingRenderer();
</span><span class="cx"> 
</span><ins>+    URL absoluteLinkURL() const;
+
</ins><span class="cx"> protected:
</span><span class="cx">     Element(const QualifiedName&amp; tagName, Document&amp; document, ConstructionType type)
</span><span class="cx">         : ContainerNode(document, type)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/HitTestResult.cpp        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebCore/rendering/HitTestResult.cpp        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -507,18 +507,9 @@
</span><span class="cx"> 
</span><span class="cx"> URL HitTestResult::absoluteLinkURL() const
</span><span class="cx"> {
</span><del>-    if (!m_innerURLElement)
-        return URL();
-
-    AtomicString urlString;
-    if (isHTMLAnchorElement(m_innerURLElement.get()) || isHTMLAreaElement(m_innerURLElement.get()) || m_innerURLElement-&gt;hasTagName(linkTag))
-        urlString = m_innerURLElement-&gt;getAttribute(hrefAttr);
-    else if (m_innerURLElement-&gt;hasTagName(SVGNames::aTag))
-        urlString = m_innerURLElement-&gt;getAttribute(XLinkNames::hrefAttr);
-    else
-        return URL();
-
-    return m_innerURLElement-&gt;document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlString));
</del><ins>+    if (m_innerURLElement)
+        return m_innerURLElement-&gt;absoluteLinkURL();
+    return URL();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool HitTestResult::isLiveLink() const
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-05-05  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
+
+        [iOS][WK2] Prefetch DNS hostnames on tap highlight
+        https://bugs.webkit.org/show_bug.cgi?id=132509
+
+        Reviewed by Alexey Proskuryakov.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::tapHighlightAtPosition):
+
</ins><span class="cx"> 2014-05-05  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (168338 => 168339)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-06 01:10:30 UTC (rev 168338)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-05-06 01:14:02 UTC (rev 168339)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #import &quot;WebProcess.h&quot;
</span><span class="cx"> #import &lt;CoreText/CTFont.h&gt;
</span><span class="cx"> #import &lt;WebCore/Chrome.h&gt;
</span><ins>+#import &lt;WebCore/DNS.h&gt;
</ins><span class="cx"> #import &lt;WebCore/Element.h&gt;
</span><span class="cx"> #import &lt;WebCore/EventHandler.h&gt;
</span><span class="cx"> #import &lt;WebCore/FloatQuad.h&gt;
</span><span class="lines">@@ -366,10 +367,11 @@
</span><span class="cx">     if (!node)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    RenderObject *renderer = node-&gt;renderer();
</del><ins>+    if (isElement(*node))
+        prefetchDNS(toElement(*node).absoluteLinkURL().host());
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    if (renderer) {
</del><ins>+    if (RenderObject *renderer = node-&gt;renderer()) {
</ins><span class="cx">         renderer-&gt;absoluteQuads(quads);
</span><span class="cx">         Color highlightColor = renderer-&gt;style().tapHighlightColor();
</span><span class="cx">         if (!node-&gt;document().frame()-&gt;isMainFrame()) {
</span></span></pre>
</div>
</div>

</body>
</html>