Chromium Code Reviews| Index: Source/core/html/imports/HTMLImportChild.cpp |
| diff --git a/Source/core/html/imports/HTMLImportChild.cpp b/Source/core/html/imports/HTMLImportChild.cpp |
| index 3b8cd484b5ae89f248b749ff2b194171cc7e7258..2c94060b2d63907f0dd0fc2099fe9e739a91b32d 100644 |
| --- a/Source/core/html/imports/HTMLImportChild.cpp |
| +++ b/Source/core/html/imports/HTMLImportChild.cpp |
| @@ -206,9 +206,24 @@ void HTMLImportChild::shareLoader(HTMLImportChild* loader) |
| stateWillChange(); |
| } |
| +bool HTMLImportChild::isWaitingForCustomElementMicrotaskSteps() const |
| +{ |
| + if (m_loader->microtaskQueue()->isEmpty()) |
| + return false; |
| + |
| + size_t ignorableStepCount = 0; |
| + for (HTMLImport* i = firstChild(); i; i = i->next()) { |
| + HTMLImportChild* child = toHTMLImportChild(i); |
| + if (child->hasMicrotaskStep() && !child->isSync()) |
| + ignorableStepCount++; |
| + } |
| + |
| + return ignorableStepCount < m_loader->microtaskQueue()->size(); |
|
dominicc (has gone to gerrit)
2014/05/23 00:29:25
Wrote a huge comment about this, but let me try an
|
| +} |
| + |
| bool HTMLImportChild::isDone() const |
| { |
| - return m_loader && m_loader->isDone() && !m_loader->microtaskQueue()->needsProcessOrStop() && !m_customElementMicrotaskStep; |
| + return m_loader && m_loader->isDone() && !isWaitingForCustomElementMicrotaskSteps() && !m_customElementMicrotaskStep; |
| } |
| bool HTMLImportChild::loaderHasError() const |