Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: Source/core/html/parser/HTMLScriptRunner.cpp

Issue 146043008: Verify that appendChild(script) does not perform a microtask checkpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/dom/MutationObserver/script-append-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/MutationObserver/script-append-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698