| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 // We will not have a scriptRunner when parsing a DocumentFragment. | 258 // We will not have a scriptRunner when parsing a DocumentFragment. |
| 259 if (m_scriptRunner) | 259 if (m_scriptRunner) |
| 260 m_scriptRunner->execute(scriptElement, scriptStartPosition); | 260 m_scriptRunner->execute(scriptElement, scriptStartPosition); |
| 261 } | 261 } |
| 262 | 262 |
| 263 bool HTMLDocumentParser::canTakeNextToken() | 263 bool HTMLDocumentParser::canTakeNextToken() |
| 264 { | 264 { |
| 265 if (isStopped()) | 265 if (isStopped()) |
| 266 return false; | 266 return false; |
| 267 | 267 |
| 268 if (isWaitingForScripts()) { | 268 // If we're paused waiting for a script, we try to execute scripts before co
ntinuing. |
| 269 // If we're paused waiting for a script, we try to execute scripts befor
e continuing. | 269 if (m_treeBuilder->hasParserBlockingScript()) |
| 270 runScriptsForPausedTreeBuilder(); | 270 runScriptsForPausedTreeBuilder(); |
| 271 if (isStopped()) | 271 if (isStopped() || isWaitingForScripts()) |
| 272 return false; | 272 return false; |
| 273 if (isWaitingForScripts()) | |
| 274 return false; | |
| 275 } | |
| 276 | 273 |
| 277 // FIXME: It's wrong for the HTMLDocumentParser to reach back to the | 274 // FIXME: It's wrong for the HTMLDocumentParser to reach back to the |
| 278 // LocalFrame, but this approach is how the old parser handled | 275 // LocalFrame, but this approach is how the old parser handled |
| 279 // stopping when the page assigns window.location. What really | 276 // stopping when the page assigns window.location. What really |
| 280 // should happen is that assigning window.location causes the | 277 // should happen is that assigning window.location causes the |
| 281 // parser to stop parsing cleanly. The problem is we're not | 278 // parser to stop parsing cleanly. The problem is we're not |
| 282 // perpared to do that at every point where we run JavaScript. | 279 // perpared to do that at every point where we run JavaScript. |
| 283 if (!isParsingFragment() | 280 if (!isParsingFragment() |
| 284 && document()->frame() && document()->frame()->navigationScheduler().loc
ationChangePending()) | 281 && document()->frame() && document()->frame()->navigationScheduler().loc
ationChangePending()) |
| 285 return false; | 282 return false; |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 DEFINE_STATIC_LOCAL(CustomCountHistogram, successHistogram, ("PreloadSca
nner.DocumentWrite.ExecutionTime.Success", 1, 10000, 50)); | 1108 DEFINE_STATIC_LOCAL(CustomCountHistogram, successHistogram, ("PreloadSca
nner.DocumentWrite.ExecutionTime.Success", 1, 10000, 50)); |
| 1112 successHistogram.count(duration); | 1109 successHistogram.count(duration); |
| 1113 } else { | 1110 } else { |
| 1114 DEFINE_STATIC_LOCAL(CustomCountHistogram, failureHistogram, ("PreloadSca
nner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50)); | 1111 DEFINE_STATIC_LOCAL(CustomCountHistogram, failureHistogram, ("PreloadSca
nner.DocumentWrite.ExecutionTime.Failure", 1, 10000, 50)); |
| 1115 failureHistogram.count(duration); | 1112 failureHistogram.count(duration); |
| 1116 } | 1113 } |
| 1117 | 1114 |
| 1118 } | 1115 } |
| 1119 | 1116 |
| 1120 } // namespace blink | 1117 } // namespace blink |
| OLD | NEW |