[webkit-reviews] review granted: [Bug 132509] [iOS][WK2] Prefetch DNS hostnames on tap highlight : [Attachment 230731] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 2 22:28:51 PDT 2014


Ryosuke Niwa <rniwa at webkit.org> has granted Benjamin Poulain
<benjamin at webkit.org>'s request for review:
Bug 132509: [iOS][WK2] Prefetch DNS hostnames on tap highlight
https://bugs.webkit.org/show_bug.cgi?id=132509

Attachment 230731: Patch
https://bugs.webkit.org/attachment.cgi?id=230731&action=review

------- Additional Comments from Ryosuke Niwa <rniwa at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=230731&action=review


> Source/WebCore/dom/Document.cpp:4893
> +void Document::prefetchDNSFrom(const Node& node)
> +{
> +    if (node.isLink() && isElement(node)) {
> +	   const Element& linkTypeElement = toElement(node);
> +
> +	   AtomicString urlString;
> +	   if (linkTypeElement.hasTagName(SVGNames::aTag))
> +	       urlString = linkTypeElement.getAttribute(XLinkNames::hrefAttr);
> +	   else
> +	       urlString = linkTypeElement.getAttribute(HTMLNames::hrefAttr);
> +	   if (!urlString.isEmpty()) {
> +	       URL absoluteURL =
linkTypeElement.document().completeURL(stripLeadingAndTrailingHTMLSpaces(urlStr
ing));
> +	       prefetchDNS(absoluteURL.host());
> +	   }
> +    }
> +}

It would be nice if we could just make this a member function of Element
instead.
And I guess we should share this code with HTMLAnchorElement::parseAttribute.


More information about the webkit-reviews mailing list