Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Unified Diff: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp

Issue 1443663003: Implement the 'noopener' link relation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: browsertest Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
index 4f07d032c5f03880eed353c6da3e3a3b1e04d47d..2e94e235294c41fe4788339ce2412d2a203e2f4a 100644
--- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
@@ -300,6 +300,8 @@ void HTMLAnchorElement::setRel(const AtomicString& value)
// FIXME: Add link relations as they are implemented
if (newLinkRelations.contains("noreferrer"))
m_linkRelations |= RelationNoReferrer;
+ if (newLinkRelations.contains("noopener"))
+ m_linkRelations |= RelationNoOpener;
}
const AtomicString& HTMLAnchorElement::name() const
@@ -371,6 +373,8 @@ void HTMLAnchorElement::handleClick(Event* event)
frameRequest.setShouldSendReferrer(NeverSendReferrer);
frameRequest.setShouldSetOpener(NeverSetOpener);
}
+ if (hasRel(RelationNoOpener))
+ frameRequest.setShouldSetOpener(NeverSetOpener);
frame->loader().load(frameRequest);
}
}

Powered by Google App Engine
This is Rietveld 408576698