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 #ifndef CustomElement_h | 5 #ifndef CustomElement_h |
6 #define CustomElement_h | 6 #define CustomElement_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/HTMLNames.h" | 9 #include "core/HTMLNames.h" |
10 #include "core/dom/Element.h" | 10 #include "core/dom/Element.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 return false; | 58 return false; |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 return !isHyphenatedSpecElementName(name); | 62 return !isHyphenatedSpecElementName(name); |
63 } | 63 } |
64 | 64 |
65 static bool shouldCreateCustomElement(const AtomicString& localName); | 65 static bool shouldCreateCustomElement(const AtomicString& localName); |
66 static bool shouldCreateCustomElement(const QualifiedName&); | 66 static bool shouldCreateCustomElement(const QualifiedName&); |
67 | 67 |
68 static HTMLElement* createCustomElementSync(Document&, | 68 static HTMLElement* createCustomElementSync( |
69 const AtomicString& localName); | 69 Document&, |
70 static HTMLElement* createCustomElementSync(Document&, const QualifiedName&); | 70 const AtomicString& localName, |
| 71 const AtomicString& is = AtomicString()); |
| 72 static HTMLElement* createCustomElementSync( |
| 73 Document&, |
| 74 const QualifiedName&, |
| 75 const AtomicString& is = AtomicString()); |
71 static HTMLElement* createCustomElementAsync(Document&, const QualifiedName&); | 76 static HTMLElement* createCustomElementAsync(Document&, const QualifiedName&); |
72 | 77 |
73 static HTMLElement* createFailedElement(Document&, const QualifiedName&); | 78 static HTMLElement* createFailedElement(Document&, const QualifiedName&); |
74 | 79 |
75 static void enqueue(Element*, CustomElementReaction*); | 80 static void enqueue(Element*, CustomElementReaction*); |
76 static void enqueueConnectedCallback(Element*); | 81 static void enqueueConnectedCallback(Element*); |
77 static void enqueueDisconnectedCallback(Element*); | 82 static void enqueueDisconnectedCallback(Element*); |
78 static void enqueueAdoptedCallback(Element*, | 83 static void enqueueAdoptedCallback(Element*, |
79 Document* oldOwner, | 84 Document* oldOwner, |
80 Document* newOwner); | 85 Document* newOwner); |
81 static void enqueueAttributeChangedCallback(Element*, | 86 static void enqueueAttributeChangedCallback(Element*, |
82 const QualifiedName&, | 87 const QualifiedName&, |
83 const AtomicString& oldValue, | 88 const AtomicString& oldValue, |
84 const AtomicString& newValue); | 89 const AtomicString& newValue); |
85 | 90 |
86 static void tryToUpgrade(Element*); | 91 static void tryToUpgrade(Element*); |
87 | 92 |
88 private: | 93 private: |
89 // Some existing specs have element names with hyphens in them, | 94 // Some existing specs have element names with hyphens in them, |
90 // like font-face in SVG. The custom elements spec explicitly | 95 // like font-face in SVG. The custom elements spec explicitly |
91 // disallows these as custom element names. | 96 // disallows these as custom element names. |
92 // https://html.spec.whatwg.org/#valid-custom-element-name | 97 // https://html.spec.whatwg.org/#valid-custom-element-name |
93 static bool isHyphenatedSpecElementName(const AtomicString&); | 98 static bool isHyphenatedSpecElementName(const AtomicString&); |
94 static HTMLElement* createUndefinedElement(Document&, const QualifiedName&); | 99 static HTMLElement* createUndefinedElement(Document&, const QualifiedName&); |
95 }; | 100 }; |
96 | 101 |
97 } // namespace blink | 102 } // namespace blink |
98 | 103 |
99 #endif // CustomElement_h | 104 #endif // CustomElement_h |
OLD | NEW |