| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 if (!Character::isPotentialCustomElementNameChar(ch)) | 57 if (!Character::isPotentialCustomElementNameChar(ch)) |
| 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 static bool shouldCreateCustomizedBuiltinElement( |
| 68 const AtomicString& localName); |
| 69 static bool shouldCreateCustomizedBuiltinElement(const QualifiedName&); |
| 67 | 70 |
| 68 static HTMLElement* createCustomElementSync( | 71 static HTMLElement* createCustomElementSync(Document&, const QualifiedName&); |
| 69 Document&, | 72 static HTMLElement* createCustomElementSync(Document&, |
| 70 const AtomicString& localName, | 73 const AtomicString& localName, |
| 71 const AtomicString& is = AtomicString()); | 74 CustomElementDefinition*); |
| 72 static HTMLElement* createCustomElementSync( | 75 static HTMLElement* createCustomElementSync(Document&, |
| 73 Document&, | 76 const QualifiedName&, |
| 74 const QualifiedName&, | 77 CustomElementDefinition*); |
| 75 const AtomicString& is = AtomicString()); | |
| 76 static HTMLElement* createCustomElementAsync(Document&, const QualifiedName&); | 78 static HTMLElement* createCustomElementAsync(Document&, const QualifiedName&); |
| 77 | 79 |
| 78 static HTMLElement* createFailedElement(Document&, const QualifiedName&); | 80 static HTMLElement* createFailedElement(Document&, const QualifiedName&); |
| 79 | 81 |
| 80 static void enqueue(Element*, CustomElementReaction*); | 82 static void enqueue(Element*, CustomElementReaction*); |
| 81 static void enqueueConnectedCallback(Element*); | 83 static void enqueueConnectedCallback(Element*); |
| 82 static void enqueueDisconnectedCallback(Element*); | 84 static void enqueueDisconnectedCallback(Element*); |
| 83 static void enqueueAdoptedCallback(Element*, | 85 static void enqueueAdoptedCallback(Element*, |
| 84 Document* oldOwner, | 86 Document* oldOwner, |
| 85 Document* newOwner); | 87 Document* newOwner); |
| 86 static void enqueueAttributeChangedCallback(Element*, | 88 static void enqueueAttributeChangedCallback(Element*, |
| 87 const QualifiedName&, | 89 const QualifiedName&, |
| 88 const AtomicString& oldValue, | 90 const AtomicString& oldValue, |
| 89 const AtomicString& newValue); | 91 const AtomicString& newValue); |
| 90 | 92 |
| 91 static void tryToUpgrade(Element*); | 93 static void tryToUpgrade(Element*); |
| 92 | 94 |
| 93 private: | 95 private: |
| 94 // Some existing specs have element names with hyphens in them, | 96 // Some existing specs have element names with hyphens in them, |
| 95 // like font-face in SVG. The custom elements spec explicitly | 97 // like font-face in SVG. The custom elements spec explicitly |
| 96 // disallows these as custom element names. | 98 // disallows these as custom element names. |
| 97 // https://html.spec.whatwg.org/#valid-custom-element-name | 99 // https://html.spec.whatwg.org/#valid-custom-element-name |
| 98 static bool isHyphenatedSpecElementName(const AtomicString&); | 100 static bool isHyphenatedSpecElementName(const AtomicString&); |
| 99 static HTMLElement* createUndefinedElement(Document&, const QualifiedName&); | 101 static HTMLElement* createUndefinedElement(Document&, const QualifiedName&); |
| 100 }; | 102 }; |
| 101 | 103 |
| 102 } // namespace blink | 104 } // namespace blink |
| 103 | 105 |
| 104 #endif // CustomElement_h | 106 #endif // CustomElement_h |
| OLD | NEW |