Permalink
Browse files

pluggable script evaluators are now available for scripts from extern…

…al sources
  • Loading branch information...
1 parent f829a22 commit a72b92011f56a8db658166d3cc61297ea52abbe0 @marshall committed Feb 18, 2009
Showing with 10 additions and 9 deletions.
  1. +0 −8 WebCore/dom/ScriptEvaluator.cpp
  2. +10 −1 WebCore/html/HTMLTokenizer.cpp
@@ -1,8 +0,0 @@
-#include "config.h"
-#include "ScriptEvaluator.h"
-#include "ScriptSourceCode.h"
-
-namespace WebCore
-{
- ScriptEvaluator
-}
@@ -1995,8 +1995,17 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
if (errorOccurred)
EventTargetNodeCast(n.get())->dispatchEventForType(eventNames().errorEvent, true, false);
else {
- if (static_cast<HTMLScriptElement*>(n.get())->shouldExecuteAsJavaScript())
+ HTMLScriptElement *el = static_cast<HTMLScriptElement*>(n.get());
+
+ if (el->shouldExecuteAsJavaScript()) {
m_state = scriptExecution(sourceCode, m_state);
+ }
+ m_scriptEvaluator = el->findEvaluator();
+ m_scriptMimeType = el->type();
+
+ if (m_scriptEvaluator && m_scriptEvaluator->matchesMimeType(m_scriptMimeType)) {
+ m_state = scriptExecution(sourceCode, m_state);
+ }
EventTargetNodeCast(n.get())->dispatchEventForType(eventNames().loadEvent, false, false);
}

0 comments on commit a72b920

Please sign in to comment.