Index: Source/WebCore/dom/ScriptElement.cpp |
diff --git a/Source/WebCore/dom/ScriptElement.cpp b/Source/WebCore/dom/ScriptElement.cpp |
index 839fb6358f89b466ef3aac190ed85e94b5cfa90d..64bb435b0a0f8c4617c6b7aea4e58328c25404e6 100644 |
--- a/Source/WebCore/dom/ScriptElement.cpp |
+++ b/Source/WebCore/dom/ScriptElement.cpp |
@@ -161,6 +161,12 @@ bool ScriptElement::isScriptTypeSupported(LegacyTypeSupport supportLegacyTypes) |
return true; |
} else if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSpace().lower()) || (supportLegacyTypes == AllowLegacyTypeInTypeAttribute && isLegacySupportedJavaScriptLanguage(type))) |
return true; |
+ else { |
+ // FIXME: move JavaScript related logic to ScriptController::isScriptTypeSupported? |
+ Frame* frame = m_element->document()->frame(); |
+ if (frame && frame->script()->isScriptTypeSupported(type.stripWhiteSpace().lower())) |
+ return true; |
+ } |
return false; |
} |
@@ -298,7 +304,10 @@ void ScriptElement::executeScript(const ScriptSourceCode& sourceCode) |
// Create a script from the script element node, using the script |
// block's source and the script block's type. |
// Note: This is where the script is compiled and actually executed. |
- frame->script()->evaluate(sourceCode); |
+ // FIXME: ScriptSourceCode mimeType should be set by the caller. |
+ ScriptSourceCode sourceCodeCopy(sourceCode); |
+ sourceCodeCopy.setMimeType(typeAttributeValue().stripWhiteSpace().lower()); |
+ frame->script()->evaluate(sourceCodeCopy); |
} |
Document::updateStyleForAllDocuments(); |