Title: [168339] trunk/Source
Revision
168339
Author
[email protected]
Date
2014-05-05 18:14:02 -0700 (Mon, 05 May 2014)

Log Message

[iOS][WK2] Prefetch DNS hostnames on tap highlight
https://bugs.webkit.org/show_bug.cgi?id=132509

Patch by Benjamin Poulain <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (168338 => 168339)


--- 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)
@@ -1,3 +1,15 @@
+2014-05-05  Benjamin Poulain  <[email protected]>
+
+        [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()):
+
 2014-05-05  Simon Fraser  <[email protected]>
 
         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch

Modified: trunk/Source/WebCore/WebCore.exp.in (168338 => 168339)


--- 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)
@@ -2457,6 +2457,7 @@
 __ZN7WebCore11MemoryCache18pruneDeadResourcesEv
 __ZN7WebCore11MemoryCache18pruneLiveResourcesEb
 __ZN7WebCore11isEndOfLineERKNS_15VisiblePositionE
+__ZN7WebCore11prefetchDNSERKN3WTF6StringE
 __ZN7WebCore12AudioSession11setCategoryENS0_12CategoryTypeE
 __ZN7WebCore12AudioSession13sharedSessionEv
 __ZN7WebCore12EventHandler10mouseMovedEP8WebEvent
@@ -2658,6 +2659,7 @@
 __ZN7WebCore9FrameView35setUseCustomFixedPositionLayoutRectEb
 __ZN7WebCore9FrameView36scheduleLayerFlushAllowingThrottlingEv
 __ZN7WebCore9PageGroup17removeVisitedLinkERKNS_3URLE
+__ZNK7WebCore7Element15absoluteLinkURLEv
 __ZNK7WebCore9FrameView17wasScrolledByUserEv
 __ZNK7WebCore10FloatPointcv7CGPointEv
 __ZNK7WebCore10ScrollView21unobscuredContentRectENS_14ScrollableArea36VisibleContentRectIncludesScrollbarsE

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (168338 => 168339)


--- 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)
@@ -4634,7 +4634,7 @@
 		B2E4EC970D00C22B00432643 /* SVGZoomEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2E4EC940D00C22B00432643 /* SVGZoomEvent.cpp */; };
 		B2E4EC980D00C22B00432643 /* SVGZoomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E4EC950D00C22B00432643 /* SVGZoomEvent.h */; };
 		B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2ED97700B1F55CE00257D0F /* GraphicsContextCG.cpp */; };
-		B2F34FE60E82F81400F627CD /* DNS.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F34FE50E82F81400F627CD /* DNS.h */; };
+		B2F34FE60E82F81400F627CD /* DNS.h in Headers */ = {isa = PBXBuildFile; fileRef = B2F34FE50E82F81400F627CD /* DNS.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		B2F34FE90E82F82700F627CD /* DNSCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2F34FE80E82F82700F627CD /* DNSCFNet.cpp */; };
 		B2FA3D360AB75A6F000E5AC4 /* JSSVGAnimateColorElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2FA3C4E0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.cpp */; };
 		B2FA3D370AB75A6F000E5AC4 /* JSSVGAnimateColorElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B2FA3C4F0AB75A6E000E5AC4 /* JSSVGAnimateColorElement.h */; };

Modified: trunk/Source/WebCore/dom/Element.cpp (168338 => 168339)


--- 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)
@@ -77,6 +77,7 @@
 #include "TextIterator.h"
 #include "VoidCallback.h"
 #include "WheelEvent.h"
+#include "XLinkNames.h"
 #include "XMLNSNames.h"
 #include "XMLNames.h"
 #include "htmlediting.h"
@@ -1168,6 +1169,23 @@
         setNeedsStyleRecalc();
 }
 
+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));
+}
+
 // Returns true is the given attribute is an event handler.
 // We consider an event handler any attribute that begins with "on".
 // It is a simple solution that has the advantage of not requiring any

Modified: trunk/Source/WebCore/dom/Element.h (168338 => 168339)


--- 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)
@@ -566,6 +566,8 @@
     void clearStyleDerivedDataBeforeDetachingRenderer();
     void clearHoverAndActiveStatusBeforeDetachingRenderer();
 
+    URL absoluteLinkURL() const;
+
 protected:
     Element(const QualifiedName& tagName, Document& document, ConstructionType type)
         : ContainerNode(document, type)

Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (168338 => 168339)


--- 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)
@@ -507,18 +507,9 @@
 
 URL HitTestResult::absoluteLinkURL() const
 {
-    if (!m_innerURLElement)
-        return URL();
-
-    AtomicString urlString;
-    if (isHTMLAnchorElement(m_innerURLElement.get()) || isHTMLAreaElement(m_innerURLElement.get()) || m_innerURLElement->hasTagName(linkTag))
-        urlString = m_innerURLElement->getAttribute(hrefAttr);
-    else if (m_innerURLElement->hasTagName(SVGNames::aTag))
-        urlString = m_innerURLElement->getAttribute(XLinkNames::hrefAttr);
-    else
-        return URL();
-
-    return m_innerURLElement->document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlString));
+    if (m_innerURLElement)
+        return m_innerURLElement->absoluteLinkURL();
+    return URL();
 }
 
 bool HitTestResult::isLiveLink() const

Modified: trunk/Source/WebKit2/ChangeLog (168338 => 168339)


--- 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)
@@ -1,3 +1,13 @@
+2014-05-05  Benjamin Poulain  <[email protected]>
+
+        [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):
+
 2014-05-05  Simon Fraser  <[email protected]>
 
         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (168338 => 168339)


--- 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)
@@ -48,6 +48,7 @@
 #import "WebProcess.h"
 #import <CoreText/CTFont.h>
 #import <WebCore/Chrome.h>
+#import <WebCore/DNS.h>
 #import <WebCore/Element.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/FloatQuad.h>
@@ -366,10 +367,11 @@
     if (!node)
         return;
 
-    RenderObject *renderer = node->renderer();
+    if (isElement(*node))
+        prefetchDNS(toElement(*node).absoluteLinkURL().host());
 
     Vector<FloatQuad> quads;
-    if (renderer) {
+    if (RenderObject *renderer = node->renderer()) {
         renderer->absoluteQuads(quads);
         Color highlightColor = renderer->style().tapHighlightColor();
         if (!node->document().frame()->isMainFrame()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to