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

Unified Diff: Source/WebCore/dom/ScriptElement.cpp

Issue 8806015: Changes to support a second VM. (Closed) Base URL: svn://svn.chromium.org/dash/experimental/chrome/src/webkit-full
Patch Set: . Created 9 years 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
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();

Powered by Google App Engine
This is Rietveld 408576698