Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / parser / HTMLParserOptions.cpp
index 8aabcd1..d4c9255 100644 (file)
 #include "config.h"
 #include "core/html/parser/HTMLParserOptions.h"
 
-#include "bindings/v8/ScriptController.h"
+#include "bindings/core/v8/ScriptController.h"
 #include "core/dom/Document.h"
 #include "core/frame/LocalFrame.h"
 #include "core/frame/Settings.h"
 #include "core/loader/FrameLoader.h"
 
-namespace WebCore {
+namespace blink {
 
 HTMLParserOptions::HTMLParserOptions(Document* document)
 {
@@ -40,18 +40,15 @@ HTMLParserOptions::HTMLParserOptions(Document* document)
     scriptEnabled = frame && frame->script().canExecuteScripts(NotAboutToExecuteScript);
     pluginsEnabled = frame && frame->loader().allowPlugins(NotAboutToInstantiatePlugin);
 
-    // We force the main-thread parser for about:blank and javascript:
-    // (which uses about:blank urls) and data: urls for compatibility
-    // with historical synchronous loading/parsing behavior.
+    // We force the main-thread parser for three cases:
+    // - about:blank and javascript (which uses about:blank) for compatibility
+    //   with historical synchronous loading/parsing behavior.
+    // - HTML imports (FIXME: enable off-thread parser for this case)
+    // - inspector/DOMPatchSupport replacing the whole document.
+    //   (DOMPatchSupport calls in |DocumentParser::pinToMainThread()| for this case)
     // FIXME: Gecko does not load javascript: urls synchronously, why do we?
     // See LayoutTests/loader/iframe-sync-loads.html
-    // FIXME: threadedHTMLParser() setting should be removed but currently many
-    // webkit_unit_tests depend on parsing being synchronous. crbug.com/366354
-    // FIXME: useThreadedHTMLParserForDataURLs() setting should be removed but
-    // currently many browser_tests depend on data: urls being synchronous! crbug.com/308321
-    Settings* settings = document ? document->settings() : 0;
-    useThreading = settings && settings->threadedHTMLParser() && !document->url().isAboutBlankURL()
-        && (settings->useThreadedHTMLParserForDataURLs() || !document->url().protocolIsData());
+    useThreading = document && !document->importsController() && !document->url().isAboutBlankURL();
 }
 
 }