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

Unified Diff: Source/core/dom/custom/CustomElementMicrotaskQueue.cpp

Issue 249563003: REGRESSION(r171966): Custom elements in async imports don't get upgrade. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/custom/CustomElementMicrotaskQueue.cpp
diff --git a/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp b/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp
index 234d02928864d33274b56e48d9e020f3fa733c03..4e2c25f87f411aaa9e0e5ef6cc08e5f4e6af7f67 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp
+++ b/Source/core/dom/custom/CustomElementMicrotaskQueue.cpp
@@ -83,23 +83,24 @@ void CustomElementMicrotaskQueue::enqueue(PassOwnPtr<CustomElementMicrotaskStep>
CustomElementMicrotaskStep::Result CustomElementMicrotaskQueue::dispatch()
{
MicrotaskQueueInvocationScope scope(this);
- Result result = CustomElementMicrotaskStep::Continue;
+ Vector<OwnPtr<CustomElementMicrotaskStep> > remaining;
+ Result accumulatedResult = CustomElementMicrotaskStep::ContinueWithRemoving;
unsigned i;
for (i = 0; i < m_queue.size(); ++i) {
- result = Result(result | m_queue[i]->process());
-
+ Result result = m_queue[i]->process();
+ accumulatedResult = CustomElementMicrotaskStep::Result(result | accumulatedResult);
+ if (result & CustomElementMicrotaskStep::ShouldRemain)
+ remaining.append(m_queue[i].release());
if (result & CustomElementMicrotaskStep::ShouldStop)
break;
}
- bool wasStopped = i < m_queue.size();
- if (wasStopped)
- m_queue.remove(0, i);
- else
- m_queue.resize(0);
+ for (++i; i < m_queue.size(); ++i)
+ remaining.append(m_queue[i].release());
+ m_queue.swap(remaining);
- return result;
+ return accumulatedResult;
}
#if !defined(NDEBUG)
@@ -109,7 +110,7 @@ void CustomElementMicrotaskQueue::show(unsigned indent)
if (m_queue[q])
m_queue[q]->show(indent);
else
- fprintf(stderr, "%*s\n", indent, "");
+ fprintf(stderr, "%*snull\n", indent, "");
}
}
#endif

Powered by Google App Engine
This is Rietveld 408576698