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

Unified Diff: Source/core/html/HTMLLinkElement.cpp

Issue 205523003: Remove beforeload events. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove more tests Created 6 years, 9 months 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
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLLinkElement.cpp
diff --git a/Source/core/html/HTMLLinkElement.cpp b/Source/core/html/HTMLLinkElement.cpp
index 09090654a5a551a637101969c43b849f5858fe9d..984ab8a74100bbf2d31f277fabe79d89aa483411 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -136,7 +136,6 @@ inline HTMLLinkElement::HTMLLinkElement(Document& document, bool createdByParser
, m_sizes(DOMSettableTokenList::create())
, m_createdByParser(createdByParser)
, m_isInShadowTree(false)
- , m_beforeLoadRecurseCount(0)
{
ScriptWrappable::init(this);
}
@@ -176,9 +175,7 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri
} else if (name == disabledAttr) {
if (LinkStyle* link = linkStyle())
link->setDisabledState(!value.isNull());
- } else if (name == onbeforeloadAttr)
- setAttributeEventListener(EventTypeNames::beforeload, createAttributeEventListener(this, name, value));
- else {
+ } else {
if (name == titleAttr) {
if (LinkStyle* link = linkStyle())
link->setSheetTitle(value);
@@ -190,25 +187,7 @@ void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri
bool HTMLLinkElement::shouldLoadLink()
{
- bool continueLoad = true;
- RefPtr<Document> originalDocument(document());
- int recursionRank = ++m_beforeLoadRecurseCount;
- if (!dispatchBeforeLoadEvent(getNonEmptyURLAttribute(hrefAttr)))
- continueLoad = false;
-
- // A beforeload handler might have removed us from the document or changed the document.
- if (continueLoad && (!inDocument() || document() != originalDocument))
- continueLoad = false;
-
- // If the beforeload handler recurses into the link element by mutating it, we should only
- // let the latest (innermost) mutation occur.
- if (recursionRank != m_beforeLoadRecurseCount)
- continueLoad = false;
-
- if (recursionRank == 1)
- m_beforeLoadRecurseCount = 0;
-
- return continueLoad;
+ return inDocument();
}
bool HTMLLinkElement::loadLink(const String& type, const KURL& url)
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698