OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 return adoptPtr(new HTMLScriptRunner(document, host)); | 49 return adoptPtr(new HTMLScriptRunner(document, host)); |
50 } | 50 } |
51 ~HTMLScriptRunner(); | 51 ~HTMLScriptRunner(); |
52 | 52 |
53 void detach(); | 53 void detach(); |
54 | 54 |
55 // Processes the passed in script and any pending scripts if possible. | 55 // Processes the passed in script and any pending scripts if possible. |
56 void execute(PassRefPtr<Element> scriptToProcess, const TextPosition& script
StartPosition); | 56 void execute(PassRefPtr<Element> scriptToProcess, const TextPosition& script
StartPosition); |
57 | 57 |
58 void executeScriptsWaitingForLoad(CachedResource*); | 58 void executeScriptsWaitingForLoad(CachedResource*); |
59 bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingFor
Stylesheets; } | 59 bool hasScriptsWaitingForResources() const { return m_hasScriptsWaitingForRe
sources; } |
60 void executeScriptsWaitingForStylesheets(); | 60 void executeScriptsWaitingForResources(); |
61 bool executeScriptsWaitingForParsing(); | 61 bool executeScriptsWaitingForParsing(); |
62 | 62 |
63 bool hasParserBlockingScript() const; | 63 bool hasParserBlockingScript() const; |
64 bool isExecutingScript() const { return !!m_scriptNestingLevel; } | 64 bool isExecutingScript() const { return !!m_scriptNestingLevel; } |
65 | 65 |
66 private: | 66 private: |
67 HTMLScriptRunner(Document*, HTMLScriptRunnerHost*); | 67 HTMLScriptRunner(Document*, HTMLScriptRunnerHost*); |
68 | 68 |
69 Frame* frame() const; | 69 Frame* frame() const; |
70 | 70 |
(...skipping 15 matching lines...) Expand all Loading... |
86 | 86 |
87 Document* m_document; | 87 Document* m_document; |
88 HTMLScriptRunnerHost* m_host; | 88 HTMLScriptRunnerHost* m_host; |
89 PendingScript m_parserBlockingScript; | 89 PendingScript m_parserBlockingScript; |
90 Deque<PendingScript> m_scriptsToExecuteAfterParsing; // http://www.whatwg.or
g/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-docume
nt-has-finished-parsing | 90 Deque<PendingScript> m_scriptsToExecuteAfterParsing; // http://www.whatwg.or
g/specs/web-apps/current-work/#list-of-scripts-that-will-execute-when-the-docume
nt-has-finished-parsing |
91 unsigned m_scriptNestingLevel; | 91 unsigned m_scriptNestingLevel; |
92 | 92 |
93 // We only want stylesheet loads to trigger script execution if script | 93 // We only want stylesheet loads to trigger script execution if script |
94 // execution is currently stopped due to stylesheet loads, otherwise we'd | 94 // execution is currently stopped due to stylesheet loads, otherwise we'd |
95 // cause nested script execution when parsing <style> tags since </style> | 95 // cause nested script execution when parsing <style> tags since </style> |
96 // tags can cause Document to call executeScriptsWaitingForStylesheets. | 96 // tags can cause Document to call executeScriptsWaitingForResources. |
97 bool m_hasScriptsWaitingForStylesheets; | 97 bool m_hasScriptsWaitingForResources; |
98 }; | 98 }; |
99 | 99 |
100 } | 100 } |
101 | 101 |
102 #endif | 102 #endif |
OLD | NEW |