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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElement.h

Issue 2505573002: CustomElements: createCustomElementSync accepts a definition (Closed)
Patch Set: createCustomElementSync accepts a definition Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 UChar32 ch; 55 UChar32 ch;
56 U16_NEXT(characters, i, name.length(), ch); 56 U16_NEXT(characters, i, name.length(), ch);
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&);
66 static bool shouldCreateCustomElement(const QualifiedName&); 66 static bool shouldCreateCustomElement(const QualifiedName&);
67 static bool shouldCreateCustomizedBuiltinElement(const AtomicString&);
dominicc (has gone to gerrit) 2016/11/17 01:39:21 I think you *do* want to name this parameter. It's
68 static bool shouldCreateCustomizedBuiltinElement(const QualifiedName&);
67 69
68 static HTMLElement* createCustomElementSync( 70 static HTMLElement* createCustomElementSync(Document&, const QualifiedName&);
69 Document&, 71 static HTMLElement* createCustomElementSync(Document&,
70 const AtomicString& localName, 72 const AtomicString& localName,
71 const AtomicString& is = AtomicString()); 73 CustomElementDefinition*);
72 static HTMLElement* createCustomElementSync( 74 static HTMLElement* createCustomElementSync(Document&,
73 Document&, 75 const QualifiedName&,
74 const QualifiedName&, 76 CustomElementDefinition*);
75 const AtomicString& is = AtomicString());
76 static HTMLElement* createCustomElementAsync(Document&, const QualifiedName&); 77 static HTMLElement* createCustomElementAsync(Document&, const QualifiedName&);
77 78
78 static HTMLElement* createFailedElement(Document&, const QualifiedName&); 79 static HTMLElement* createFailedElement(Document&, const QualifiedName&);
79 80
80 static void enqueue(Element*, CustomElementReaction*); 81 static void enqueue(Element*, CustomElementReaction*);
81 static void enqueueConnectedCallback(Element*); 82 static void enqueueConnectedCallback(Element*);
82 static void enqueueDisconnectedCallback(Element*); 83 static void enqueueDisconnectedCallback(Element*);
83 static void enqueueAdoptedCallback(Element*, 84 static void enqueueAdoptedCallback(Element*,
84 Document* oldOwner, 85 Document* oldOwner,
85 Document* newOwner); 86 Document* newOwner);
86 static void enqueueAttributeChangedCallback(Element*, 87 static void enqueueAttributeChangedCallback(Element*,
87 const QualifiedName&, 88 const QualifiedName&,
88 const AtomicString& oldValue, 89 const AtomicString& oldValue,
89 const AtomicString& newValue); 90 const AtomicString& newValue);
90 91
91 static void tryToUpgrade(Element*); 92 static void tryToUpgrade(Element*);
92 93
93 private: 94 private:
94 // Some existing specs have element names with hyphens in them, 95 // Some existing specs have element names with hyphens in them,
95 // like font-face in SVG. The custom elements spec explicitly 96 // like font-face in SVG. The custom elements spec explicitly
96 // disallows these as custom element names. 97 // disallows these as custom element names.
97 // https://html.spec.whatwg.org/#valid-custom-element-name 98 // https://html.spec.whatwg.org/#valid-custom-element-name
98 static bool isHyphenatedSpecElementName(const AtomicString&); 99 static bool isHyphenatedSpecElementName(const AtomicString&);
99 static HTMLElement* createUndefinedElement(Document&, const QualifiedName&); 100 static HTMLElement* createUndefinedElement(Document&, const QualifiedName&);
100 }; 101 };
101 102
102 } // namespace blink 103 } // namespace blink
103 104
104 #endif // CustomElement_h 105 #endif // CustomElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/custom/CustomElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698