| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 if (isStopped()) | 140 if (isStopped()) |
| 141 return; | 141 return; |
| 142 | 142 |
| 143 DocumentParser::prepareToStopParsing(); | 143 DocumentParser::prepareToStopParsing(); |
| 144 | 144 |
| 145 // We will not have a scriptRunner when parsing a DocumentFragment. | 145 // We will not have a scriptRunner when parsing a DocumentFragment. |
| 146 if (m_scriptRunner) | 146 if (m_scriptRunner) |
| 147 document()->setReadyState(Document::Interactive); | 147 document()->setReadyState(Document::Interactive); |
| 148 | 148 |
| 149 // Setting the ready state above can fire mutation event and detach us |
| 150 // from underneath. In that case, just bail out. |
| 151 if (isDetached()) |
| 152 return; |
| 153 |
| 149 attemptToRunDeferredScriptsAndEnd(); | 154 attemptToRunDeferredScriptsAndEnd(); |
| 150 } | 155 } |
| 151 | 156 |
| 152 bool HTMLDocumentParser::isParsingFragment() const | 157 bool HTMLDocumentParser::isParsingFragment() const |
| 153 { | 158 { |
| 154 return m_treeBuilder->isParsingFragment(); | 159 return m_treeBuilder->isParsingFragment(); |
| 155 } | 160 } |
| 156 | 161 |
| 157 bool HTMLDocumentParser::processingData() const | 162 bool HTMLDocumentParser::processingData() const |
| 158 { | 163 { |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 m_parserScheduler->suspend(); | 567 m_parserScheduler->suspend(); |
| 563 } | 568 } |
| 564 | 569 |
| 565 void HTMLDocumentParser::resumeScheduledTasks() | 570 void HTMLDocumentParser::resumeScheduledTasks() |
| 566 { | 571 { |
| 567 if (m_parserScheduler) | 572 if (m_parserScheduler) |
| 568 m_parserScheduler->resume(); | 573 m_parserScheduler->resume(); |
| 569 } | 574 } |
| 570 | 575 |
| 571 } | 576 } |
| OLD | NEW |