diff options
author | Steve Block <steveblock@google.com> | 2009-11-05 09:23:40 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-11-10 22:41:12 +0000 |
commit | cac0f67c402d107cdb10971b95719e2ff9c7c76b (patch) | |
tree | d182c7f87211c6f201a5f038e332336493ebdbe7 /WebCore/html/HTMLAnchorElement.cpp | |
parent | 4b2ef0f288e7c6c4602f621b7a0e9feed304b70e (diff) | |
download | external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.zip external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.gz external_webkit-cac0f67c402d107cdb10971b95719e2ff9c7c76b.tar.bz2 |
Merge webkit.org at r50258 : Initial merge by git.
Change-Id: I1a9e1dc4ed654b69174ad52a4f031a07240f37b0
Diffstat (limited to 'WebCore/html/HTMLAnchorElement.cpp')
-rw-r--r-- | WebCore/html/HTMLAnchorElement.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp index daa7919..968f144 100644 --- a/WebCore/html/HTMLAnchorElement.cpp +++ b/WebCore/html/HTMLAnchorElement.cpp @@ -27,6 +27,7 @@ #include "DNS.h" #include "EventNames.h" #include "Frame.h" +#include "FrameLoaderTypes.h" #include "HTMLImageElement.h" #include "HTMLNames.h" #include "KeyboardEvent.h" @@ -43,6 +44,7 @@ using namespace HTMLNames; HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document* document) : HTMLElement(tagName, document, CreateElement) , m_wasShiftKeyDownOnMouseDown(false) + , m_linkRelations(0) { } @@ -67,7 +69,7 @@ bool HTMLAnchorElement::supportsFocus() const bool HTMLAnchorElement::isMouseFocusable() const { // Anchor elements should be mouse focusable, https://bugs.webkit.org/show_bug.cgi?id=26856 -#if !PLATFORM(GTK) +#if PLATFORM(MAC) if (isLink()) return false; #endif @@ -200,7 +202,7 @@ void HTMLAnchorElement::defaultEventHandler(Event* evt) } if (!evt->defaultPrevented() && document()->frame()) - document()->frame()->loader()->urlSelected(document()->completeURL(url), getAttribute(targetAttr), evt, false, false, true); + document()->frame()->loader()->urlSelected(document()->completeURL(url), getAttribute(targetAttr), evt, false, false, true, hasRel(RelationNoReferrer) ? NoReferrer : SendReferrer); evt->setDefaultHandled(); } else if (isLink() && isContentEditable()) { @@ -274,10 +276,11 @@ void HTMLAnchorElement::parseMappedAttribute(MappedAttribute *attr) } } } else if (attr->name() == nameAttr || - attr->name() == titleAttr || - attr->name() == relAttr) { + attr->name() == titleAttr) { // Do nothing. - } else + } else if (attr->name() == relAttr) + setRel(attr->value()); + else HTMLElement::parseMappedAttribute(attr); } @@ -321,6 +324,20 @@ void HTMLAnchorElement::setHref(const AtomicString& value) setAttribute(hrefAttr, value); } +bool HTMLAnchorElement::hasRel(uint32_t relation) const +{ + return m_linkRelations & relation; +} + +void HTMLAnchorElement::setRel(const String& value) +{ + m_linkRelations = 0; + ClassNames newLinkRelations(value, true); + // FIXME: Add link relations as they are implemented + if (newLinkRelations.contains("noreferrer")) + m_linkRelations |= RelationNoReferrer; +} + const AtomicString& HTMLAnchorElement::name() const { return getAttribute(nameAttr); |