OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2013 Google, Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "HTMLParserOptions.h" | 27 #include "HTMLParserOptions.h" |
28 | 28 |
29 #include "Document.h" | 29 #include "Document.h" |
30 #include "Frame.h" | 30 #include "Frame.h" |
31 #include "FrameLoader.h" | 31 #include "FrameLoader.h" |
| 32 #include "ScriptController.h" |
32 #include "Settings.h" | 33 #include "Settings.h" |
33 | 34 |
34 namespace WebCore { | 35 namespace WebCore { |
35 | 36 |
36 HTMLParserOptions::HTMLParserOptions(Document* document) | 37 HTMLParserOptions::HTMLParserOptions(Document* document) |
37 { | 38 { |
38 Frame* frame = document ? document->frame() : 0; | 39 Frame* frame = document ? document->frame() : 0; |
39 scriptEnabled = frame && frame->script()->canExecuteScripts(NotAboutToExecut
eScript); | 40 scriptEnabled = frame && frame->script()->canExecuteScripts(NotAboutToExecut
eScript); |
40 pluginsEnabled = frame && frame->loader()->subframeLoader()->allowPlugins(No
tAboutToInstantiatePlugin); | 41 pluginsEnabled = frame && frame->loader()->subframeLoader()->allowPlugins(No
tAboutToInstantiatePlugin); |
41 | 42 |
42 Settings* settings = document ? document->settings() : 0; | 43 Settings* settings = document ? document->settings() : 0; |
43 #if ENABLE(THREADED_HTML_PARSER) | 44 #if ENABLE(THREADED_HTML_PARSER) |
44 // We force the main-thread parser for about:blank, javascript: and data: ur
ls for compatibility | 45 // We force the main-thread parser for about:blank, javascript: and data: ur
ls for compatibility |
45 // with historical synchronous loading/parsing behavior of those schemes. | 46 // with historical synchronous loading/parsing behavior of those schemes. |
46 useThreading = settings && settings->threadedHTMLParser() && !document->url(
).isBlankURL() | 47 useThreading = settings && settings->threadedHTMLParser() && !document->url(
).isBlankURL() |
47 && (settings->useThreadedHTMLParserForDataURLs() || !document->url().pro
tocolIsData()); | 48 && (settings->useThreadedHTMLParserForDataURLs() || !document->url().pro
tocolIsData()); |
48 #else | 49 #else |
49 useThreading = false; | 50 useThreading = false; |
50 #endif | 51 #endif |
51 } | 52 } |
52 | 53 |
53 } | 54 } |
OLD | NEW |