| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 enum PendingScriptType { | 71 enum PendingScriptType { |
| 72 PendingScriptBlockingParser, | 72 PendingScriptBlockingParser, |
| 73 PendingScriptDeferred | 73 PendingScriptDeferred |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 void executeParsingBlockingScript(); | 76 void executeParsingBlockingScript(); |
| 77 void executePendingScriptAndDispatchEvent(PendingScript&, PendingScriptType)
; | 77 void executePendingScriptAndDispatchEvent(PendingScript&, PendingScriptType)
; |
| 78 void executeParsingBlockingScripts(); | 78 void executeParsingBlockingScripts(); |
| 79 | 79 |
| 80 void requestParsingBlockingScript(const ResourcePtr<ScriptResource>&, Elemen
t*); | 80 void requestParsingBlockingScript(Element*); |
| 81 void requestDeferredScript(const ResourcePtr<ScriptResource>&, Element*); | 81 void requestDeferredScript(Element*); |
| 82 bool requestPendingScript(const ResourcePtr<ScriptResource>&, PendingScript&
, Element*) const; | 82 bool requestPendingScript(PendingScript&, Element*) const; |
| 83 | 83 |
| 84 void runScript(Element*, const TextPosition& scriptStartPosition); | 84 void runScript(Element*, const TextPosition& scriptStartPosition); |
| 85 | 85 |
| 86 // Helpers for dealing with HTMLScriptRunnerHost | 86 // Helpers for dealing with HTMLScriptRunnerHost |
| 87 void watchForLoad(PendingScript&); | 87 void watchForLoad(PendingScript&); |
| 88 void stopWatchingForLoad(PendingScript&); | 88 void stopWatchingForLoad(PendingScript&); |
| 89 bool isPendingScriptReady(const PendingScript&); | 89 bool isPendingScriptReady(const PendingScript&); |
| 90 ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOc
curred) const; | 90 ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOc
curred) const; |
| 91 | 91 |
| 92 Document* m_document; | 92 Document* m_document; |
| 93 HTMLScriptRunnerHost* m_host; | 93 HTMLScriptRunnerHost* m_host; |
| 94 PendingScript m_parserBlockingScript; | 94 PendingScript m_parserBlockingScript; |
| 95 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 | 95 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 |
| 96 unsigned m_scriptNestingLevel; | 96 unsigned m_scriptNestingLevel; |
| 97 | 97 |
| 98 // We only want stylesheet loads to trigger script execution if script | 98 // We only want stylesheet loads to trigger script execution if script |
| 99 // execution is currently stopped due to stylesheet loads, otherwise we'd | 99 // execution is currently stopped due to stylesheet loads, otherwise we'd |
| 100 // cause nested script execution when parsing <style> tags since </style> | 100 // cause nested script execution when parsing <style> tags since </style> |
| 101 // tags can cause Document to call executeScriptsWaitingForResources. | 101 // tags can cause Document to call executeScriptsWaitingForResources. |
| 102 bool m_hasScriptsWaitingForResources; | 102 bool m_hasScriptsWaitingForResources; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } | 105 } |
| 106 | 106 |
| 107 #endif | 107 #endif |
| OLD | NEW |