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

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

Issue 106903007: Let unresolved custom element go through CustomElementCallbackQueue. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated test. Landing again. Created 7 years 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
« no previous file with comments | « Source/core/dom/custom/CustomElementResolutionStep.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/custom/CustomElementResolutionStep.cpp
diff --git a/Source/core/dom/Microtask.cpp b/Source/core/dom/custom/CustomElementResolutionStep.cpp
similarity index 67%
copy from Source/core/dom/Microtask.cpp
copy to Source/core/dom/custom/CustomElementResolutionStep.cpp
index 27cd2178f46cfebf0ba0b3225876edecf7818578..db1b6744d18af8bb577002ded239ad6529652d18 100644
--- a/Source/core/dom/Microtask.cpp
+++ b/Source/core/dom/custom/CustomElementResolutionStep.cpp
@@ -29,28 +29,31 @@
*/
#include "config.h"
-#include "core/dom/Microtask.h"
+#include "core/dom/custom/CustomElementResolutionStep.h"
-#include "core/dom/MutationObserver.h"
-#include "core/dom/custom/CustomElementCallbackDispatcher.h"
-#include "wtf/Vector.h"
+#include "core/dom/Element.h"
+#include "core/dom/custom/CustomElementRegistrationContext.h"
namespace WebCore {
-void Microtask::performCheckpoint()
+PassOwnPtr<CustomElementResolutionStep> CustomElementResolutionStep::create(PassRefPtr<CustomElementRegistrationContext> context, const CustomElementDescriptor& descriptor)
{
- static bool performingCheckpoint = false;
- if (performingCheckpoint)
- return;
- performingCheckpoint = true;
-
- bool anyWorkDone;
- do {
- MutationObserver::deliverAllMutations();
- anyWorkDone = CustomElementCallbackDispatcher::instance().dispatch();
- } while (anyWorkDone);
-
- performingCheckpoint = false;
+ return adoptPtr(new CustomElementResolutionStep(context, descriptor));
+}
+
+CustomElementResolutionStep::CustomElementResolutionStep(PassRefPtr<CustomElementRegistrationContext> context, const CustomElementDescriptor& descriptor)
+ : m_context(context)
+ , m_descriptor(descriptor)
+{
+}
+
+CustomElementResolutionStep::~CustomElementResolutionStep()
+{
+}
+
+void CustomElementResolutionStep::dispatch(Element* element)
+{
+ m_context->resolve(element, m_descriptor);
}
} // namespace WebCore
« no previous file with comments | « Source/core/dom/custom/CustomElementResolutionStep.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698