diff options
Diffstat (limited to 'WebCore/html/HTMLAnchorElement.cpp')
-rw-r--r-- | WebCore/html/HTMLAnchorElement.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp index c6b2a95..354f9f0 100644 --- a/WebCore/html/HTMLAnchorElement.cpp +++ b/WebCore/html/HTMLAnchorElement.cpp @@ -36,6 +36,7 @@ #include "HTMLImageElement.h" #include "HTMLNames.h" #include "KeyboardEvent.h" +#include "MappedAttribute.h" #include "MouseEvent.h" #include "MutationEvent.h" #include "Page.h" @@ -280,11 +281,17 @@ void HTMLAnchorElement::parseMappedAttribute(MappedAttribute *attr) bool wasLink = isLink(); setIsLink(!attr->isNull()); if (wasLink != isLink()) - setChanged(); - if (isLink() && document()->isDNSPrefetchEnabled()) { - String value = attr->value(); - if (protocolIs(value, "http") || protocolIs(value, "https") || value.startsWith("//")) - prefetchDNS(document()->completeURL(value).host()); + setNeedsStyleRecalc(); + if (isLink()) { + String parsedURL = parseURL(attr->value()); + if (document()->isDNSPrefetchEnabled()) { + if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "https") || parsedURL.startsWith("//")) + prefetchDNS(document()->completeURL(parsedURL).host()); + } + if (document()->page() && !document()->page()->javaScriptURLsAreAllowed() && protocolIsJavaScript(parsedURL)) { + setIsLink(false); + attr->setValue(nullAtom); + } } } else if (attr->name() == nameAttr || attr->name() == titleAttr || |