diff options
Diffstat (limited to 'WebCore/dom/ScriptElement.cpp')
| -rw-r--r-- | WebCore/dom/ScriptElement.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp index 827aff3..83ed2bb 100644 --- a/WebCore/dom/ScriptElement.cpp +++ b/WebCore/dom/ScriptElement.cpp @@ -229,12 +229,14 @@ bool ScriptElementData::shouldExecuteAsJavaScript() const We want to accept all the values that either of these browsers accept, but not other values. */ String type = m_scriptElement->typeAttributeValue(); - if (!type.isEmpty()) - return MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSpace().lower()); - - String language = m_scriptElement->languageAttributeValue(); - if (!language.isEmpty()) - return isSupportedJavaScriptLanguage(language); + if (!type.isEmpty()) { + if (!MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSpace().lower())) + return false; + } else { + String language = m_scriptElement->languageAttributeValue(); + if (!language.isEmpty() && !isSupportedJavaScriptLanguage(language)) + return false; + } // No type or language is specified, so we assume the script to be JavaScript. // We don't yet support setting event listeners via the 'for' attribute for scripts. |
