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 |