#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"
-#include "core/frame/Frame.h"
-#include "core/page/Settings.h"
-namespace WebCore {
+namespace blink {
HTMLParserOptions::HTMLParserOptions(Document* document)
{
- Frame* frame = document ? document->frame() : 0;
+ LocalFrame* frame = document ? document->frame() : 0;
scriptEnabled = frame && frame->script().canExecuteScripts(NotAboutToExecuteScript);
pluginsEnabled = frame && frame->loader().allowPlugins(NotAboutToInstantiatePlugin);
- Settings* settings = document ? document->settings() : 0;
- // We force the main-thread parser for about:blank, javascript: and data: urls for compatibility
- // with historical synchronous loading/parsing behavior of those schemes.
- useThreading = settings && settings->threadedHTMLParser() && !document->url().isBlankURL()
- && (settings->useThreadedHTMLParserForDataURLs() || !document->url().protocolIsData());
+ // 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
+ useThreading = document && !document->importsController() && !document->url().isAboutBlankURL();
}
}