| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(script); | 279 ScriptLoader* scriptLoader = toScriptLoaderIfPossible(script); |
| 280 | 280 |
| 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()); |
| 290 |
| 289 Microtask::performCheckpoint(); | 291 Microtask::performCheckpoint(); |
| 290 | 292 |
| 291 InsertionPointRecord insertionPointRecord(m_host->inputStream()); | 293 InsertionPointRecord insertionPointRecord(m_host->inputStream()); |
| 292 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel); | 294 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel); |
| 293 | 295 |
| 294 scriptLoader->prepareScript(scriptStartPosition); | 296 scriptLoader->prepareScript(scriptStartPosition); |
| 295 | 297 |
| 296 if (!scriptLoader->willBeParserExecuted()) | 298 if (!scriptLoader->willBeParserExecuted()) |
| 297 return; | 299 return; |
| 298 | 300 |
| 299 if (scriptLoader->willExecuteWhenDocumentFinishedParsing()) { | 301 if (scriptLoader->willExecuteWhenDocumentFinishedParsing()) { |
| 300 requestDeferredScript(script); | 302 requestDeferredScript(script); |
| 301 } else if (scriptLoader->readyToBeParserExecuted()) { | 303 } else if (scriptLoader->readyToBeParserExecuted()) { |
| 302 if (m_scriptNestingLevel == 1) { | 304 if (m_scriptNestingLevel == 1) { |
| 303 m_parserBlockingScript.setElement(script); | 305 m_parserBlockingScript.setElement(script); |
| 304 m_parserBlockingScript.setStartingPosition(scriptStartPosition); | 306 m_parserBlockingScript.setStartingPosition(scriptStartPosition); |
| 305 } else { | 307 } else { |
| 306 ScriptSourceCode sourceCode(script->textContent(), documentURLFo
rScriptExecution(m_document), scriptStartPosition); | 308 ScriptSourceCode sourceCode(script->textContent(), documentURLFo
rScriptExecution(m_document), scriptStartPosition); |
| 307 scriptLoader->executeScript(sourceCode); | 309 scriptLoader->executeScript(sourceCode); |
| 308 } | 310 } |
| 309 } else { | 311 } else { |
| 310 requestParsingBlockingScript(script); | 312 requestParsingBlockingScript(script); |
| 311 } | 313 } |
| 312 } | 314 } |
| 313 } | 315 } |
| 314 | 316 |
| 315 } | 317 } |
| OLD | NEW |