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