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

Unified Diff: Source/core/dom/ScriptLoader.cpp

Issue 1305213005: Correct handling of |for| and |event| attributes of script elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptLoader.cpp
diff --git a/Source/core/dom/ScriptLoader.cpp b/Source/core/dom/ScriptLoader.cpp
index 5abace4357a0252c417036d9a21c3bfad8e9a964..7a16bd0582d90bc03939eba018017e0fe259262c 100644
--- a/Source/core/dom/ScriptLoader.cpp
+++ b/Source/core/dom/ScriptLoader.cpp
@@ -482,16 +482,14 @@ bool ScriptLoader::isScriptForEventSupported() const
{
String eventAttribute = client()->eventAttributeValue();
String forAttribute = client()->forAttributeValue();
- if (!eventAttribute.isEmpty() && !forAttribute.isEmpty()) {
- forAttribute = forAttribute.stripWhiteSpace();
- if (!equalIgnoringCase(forAttribute, "window"))
- return false;
+ if (eventAttribute.isNull() || forAttribute.isNull())
tkent 2015/09/02 07:37:31 This change might look complex, but it's - Replac
kochi 2015/09/02 07:47:07 Acknowledged.
+ return true;
- eventAttribute = eventAttribute.stripWhiteSpace();
- if (!equalIgnoringCase(eventAttribute, "onload") && !equalIgnoringCase(eventAttribute, "onload()"))
- return false;
- }
- return true;
+ forAttribute = forAttribute.stripWhiteSpace();
+ if (!equalIgnoringCase(forAttribute, "window"))
+ return false;
+ eventAttribute = eventAttribute.stripWhiteSpace();
+ return equalIgnoringCase(eventAttribute, "onload") || equalIgnoringCase(eventAttribute, "onload()");
}
String ScriptLoader::scriptContent() const
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698