| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 // This contains both and ASSERTION and a null check since we should not | 281 // This contains both and ASSERTION and a null check since we should not |
| 282 // be getting into the case of a null script element, but seem to be fro
m | 282 // be getting into the case of a null script element, but seem to be fro
m |
| 283 // time to time. The assertion is left in to help find those cases and | 283 // time to time. The assertion is left in to help find those cases and |
| 284 // is being tracked by <https://bugs.webkit.org/show_bug.cgi?id=60559>. | 284 // is being tracked by <https://bugs.webkit.org/show_bug.cgi?id=60559>. |
| 285 ASSERT(scriptLoader); | 285 ASSERT(scriptLoader); |
| 286 if (!scriptLoader) | 286 if (!scriptLoader) |
| 287 return; | 287 return; |
| 288 | 288 |
| 289 ASSERT(scriptLoader->isParserInserted()); | 289 ASSERT(scriptLoader->isParserInserted()); |
| 290 | 290 |
| 291 Microtask::performCheckpoint(); | 291 if (!isExecutingScript()) |
| 292 Microtask::performCheckpoint(); |
| 292 | 293 |
| 293 InsertionPointRecord insertionPointRecord(m_host->inputStream()); | 294 InsertionPointRecord insertionPointRecord(m_host->inputStream()); |
| 294 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel); | 295 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel); |
| 295 | 296 |
| 296 scriptLoader->prepareScript(scriptStartPosition); | 297 scriptLoader->prepareScript(scriptStartPosition); |
| 297 | 298 |
| 298 if (!scriptLoader->willBeParserExecuted()) | 299 if (!scriptLoader->willBeParserExecuted()) |
| 299 return; | 300 return; |
| 300 | 301 |
| 301 if (scriptLoader->willExecuteWhenDocumentFinishedParsing()) { | 302 if (scriptLoader->willExecuteWhenDocumentFinishedParsing()) { |
| 302 requestDeferredScript(script); | 303 requestDeferredScript(script); |
| 303 } else if (scriptLoader->readyToBeParserExecuted()) { | 304 } else if (scriptLoader->readyToBeParserExecuted()) { |
| 304 if (m_scriptNestingLevel == 1) { | 305 if (m_scriptNestingLevel == 1) { |
| 305 m_parserBlockingScript.setElement(script); | 306 m_parserBlockingScript.setElement(script); |
| 306 m_parserBlockingScript.setStartingPosition(scriptStartPosition); | 307 m_parserBlockingScript.setStartingPosition(scriptStartPosition); |
| 307 } else { | 308 } else { |
| 308 ScriptSourceCode sourceCode(script->textContent(), documentURLFo
rScriptExecution(m_document), scriptStartPosition); | 309 ScriptSourceCode sourceCode(script->textContent(), documentURLFo
rScriptExecution(m_document), scriptStartPosition); |
| 309 scriptLoader->executeScript(sourceCode); | 310 scriptLoader->executeScript(sourceCode); |
| 310 } | 311 } |
| 311 } else { | 312 } else { |
| 312 requestParsingBlockingScript(script); | 313 requestParsingBlockingScript(script); |
| 313 } | 314 } |
| 314 } | 315 } |
| 315 } | 316 } |
| 316 | 317 |
| 317 } | 318 } |
| OLD | NEW |