OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/dom/custom/CustomElement.h" | 5 #include "core/dom/custom/CustomElement.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/dom/QualifiedName.h" | 8 #include "core/dom/QualifiedName.h" |
| 9 #include "core/dom/custom/CEReactionsScope.h" |
| 10 #include "core/dom/custom/CustomElementUpgradeReaction.h" |
9 #include "core/dom/custom/V0CustomElement.h" | 11 #include "core/dom/custom/V0CustomElement.h" |
10 #include "core/dom/custom/V0CustomElementRegistrationContext.h" | 12 #include "core/dom/custom/V0CustomElementRegistrationContext.h" |
11 #include "core/frame/LocalDOMWindow.h" | 13 #include "core/frame/LocalDOMWindow.h" |
12 #include "core/html/HTMLElement.h" | 14 #include "core/html/HTMLElement.h" |
13 #include "platform/text/Character.h" | 15 #include "platform/text/Character.h" |
14 #include "wtf/text/AtomicStringHash.h" | 16 #include "wtf/text/AtomicStringHash.h" |
15 | 17 |
16 namespace blink { | 18 namespace blink { |
17 | 19 |
18 CustomElementsRegistry* CustomElement::registry(const Element& element) | 20 CustomElementsRegistry* CustomElement::registry(const Element& element) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 element = toHTMLElement(v0element); | 93 element = toHTMLElement(v0element); |
92 } else { | 94 } else { |
93 element = HTMLElement::create(tagName, document); | 95 element = HTMLElement::create(tagName, document); |
94 } | 96 } |
95 | 97 |
96 element->setCustomElementState(CustomElementState::Undefined); | 98 element->setCustomElementState(CustomElementState::Undefined); |
97 | 99 |
98 return element; | 100 return element; |
99 } | 101 } |
100 | 102 |
| 103 void CustomElement::enqueueUpgradeReaction(Element* element, CustomElementDefini
tion* definition) |
| 104 { |
| 105 // CEReactionsScope must be created by [CEReactions] in IDL, |
| 106 // or callers must setup explicitly if it does not go through bindings. |
| 107 DCHECK(CEReactionsScope::current()); |
| 108 CEReactionsScope::current()->enqueue(element, |
| 109 new CustomElementUpgradeReaction(definition)); |
| 110 } |
| 111 |
101 } // namespace blink | 112 } // namespace blink |
OLD | NEW |