Chromium Code Reviews| 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 |