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

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

Issue 2058823002: Implement callback reactions for Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stack-ce
Patch Set: Minor cleanup Created 4 years, 6 months 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 CustomElementDefinition_h 5 #ifndef CustomElementDefinition_h
6 #define CustomElementDefinition_h 6 #define CustomElementDefinition_h
7 7
8 #include "bindings/core/v8/ScriptValue.h" 8 #include "bindings/core/v8/ScriptValue.h"
9 #include "core/CoreExport.h" 9 #include "core/CoreExport.h"
10 #include "core/dom/custom/CustomElementDescriptor.h" 10 #include "core/dom/custom/CustomElementDescriptor.h"
(...skipping 25 matching lines...) Expand all
36 virtual ScriptValue getConstructorForScript() = 0; 36 virtual ScriptValue getConstructorForScript() = 0;
37 37
38 using ConstructionStack = HeapVector<Member<Element>, 1>; 38 using ConstructionStack = HeapVector<Member<Element>, 1>;
39 ConstructionStack& constructionStack() 39 ConstructionStack& constructionStack()
40 { 40 {
41 return m_constructionStack; 41 return m_constructionStack;
42 } 42 }
43 43
44 void upgrade(Element*); 44 void upgrade(Element*);
45 45
46 // TODO(kojii): Change these methods to pure when script-side is implemented .
47 virtual bool hasConnectedCallback() const { return true; }
48 virtual bool hasDisconnectedCallback() const { return true; }
49 virtual bool hasAttributeChangedCallback(const QualifiedName&) const { retur n true; }
50
51 virtual void runConnectedCallback(Element*) {}
52 virtual void runDisconnectedCallback(Element*) {}
53 virtual void runAttributeChangedCallback(Element*, const QualifiedName&, con st AtomicString& oldValue, const AtomicString& newValue) {}
dominicc (has gone to gerrit) 2016/06/13 07:59:01 I have been trying to keep these files to 80 cols.
54
55 void enqueueUpgradeReaction(Element*);
56 void enqueueConnectedCallback(Element*);
57 void enqueueDisconnectedCallback(Element*);
58 void enqueueAttributeChangedCallback(Element*, const QualifiedName&,
59 const AtomicString& oldValue, const AtomicString& newValue);
60
46 protected: 61 protected:
47 virtual bool runConstructor(Element*) = 0; 62 virtual bool runConstructor(Element*) = 0;
48 63
49 private: 64 private:
50 const CustomElementDescriptor m_descriptor; 65 const CustomElementDescriptor m_descriptor;
51 ConstructionStack m_constructionStack; 66 ConstructionStack m_constructionStack;
52 }; 67 };
53 68
54 } // namespace blink 69 } // namespace blink
55 70
56 #endif // CustomElementDefinition_h 71 #endif // CustomElementDefinition_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698