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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptCustomElementDefinition.h

Issue 2054433002: Implement "create an element" when sync for Custom Element V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-ce
Patch Set: haraken review and rebase 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 ScriptCustomElementDefinition_h 5 #ifndef ScriptCustomElementDefinition_h
6 #define ScriptCustomElementDefinition_h 6 #define ScriptCustomElementDefinition_h
7 7
8 #include "bindings/core/v8/ScopedPersistent.h" 8 #include "bindings/core/v8/ScopedPersistent.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
(...skipping 28 matching lines...) Expand all
39 const v8::Local<v8::Object>& connectedCallback, 39 const v8::Local<v8::Object>& connectedCallback,
40 const v8::Local<v8::Object>& disconnectedCallback, 40 const v8::Local<v8::Object>& disconnectedCallback,
41 const v8::Local<v8::Object>& attributeChangedCallback, 41 const v8::Local<v8::Object>& attributeChangedCallback,
42 const HashSet<AtomicString>& observedAttributes); 42 const HashSet<AtomicString>& observedAttributes);
43 43
44 virtual ~ScriptCustomElementDefinition() = default; 44 virtual ~ScriptCustomElementDefinition() = default;
45 45
46 v8::Local<v8::Object> constructor() const; 46 v8::Local<v8::Object> constructor() const;
47 v8::Local<v8::Object> prototype() const; 47 v8::Local<v8::Object> prototype() const;
48 48
49 HTMLElement* createElementSync(Document&, const QualifiedName&) override;
50 HTMLElement* createElementSync(Document&, const QualifiedName&, ExceptionSta te&) override;
51
49 private: 52 private:
50 ScriptCustomElementDefinition( 53 ScriptCustomElementDefinition(
51 ScriptState*, 54 ScriptState*,
52 const CustomElementDescriptor&, 55 const CustomElementDescriptor&,
53 const v8::Local<v8::Object>& constructor, 56 const v8::Local<v8::Object>& constructor,
54 const v8::Local<v8::Object>& prototype, 57 const v8::Local<v8::Object>& prototype,
55 const v8::Local<v8::Object>& connectedCallback, 58 const v8::Local<v8::Object>& connectedCallback,
56 const v8::Local<v8::Object>& disconnectedCallback, 59 const v8::Local<v8::Object>& disconnectedCallback,
57 const v8::Local<v8::Object>& attributeChangedCallback, 60 const v8::Local<v8::Object>& attributeChangedCallback,
58 const HashSet<AtomicString>& observedAttributes); 61 const HashSet<AtomicString>& observedAttributes);
59 62
60 // Implementations of |CustomElementDefinition| 63 // Implementations of |CustomElementDefinition|
61 ScriptValue getConstructorForScript() final; 64 ScriptValue getConstructorForScript() final;
62 bool runConstructor(Element*) override; 65 bool runConstructor(Element*) override;
66 Element* runConstructor();
63 67
64 RefPtr<ScriptState> m_scriptState; 68 RefPtr<ScriptState> m_scriptState;
65 ScopedPersistent<v8::Object> m_constructor; 69 ScopedPersistent<v8::Object> m_constructor;
66 ScopedPersistent<v8::Object> m_prototype; 70 ScopedPersistent<v8::Object> m_prototype;
67 ScopedPersistent<v8::Object> m_connectedCallback; 71 ScopedPersistent<v8::Object> m_connectedCallback;
68 ScopedPersistent<v8::Object> m_disconnectedCallback; 72 ScopedPersistent<v8::Object> m_disconnectedCallback;
69 ScopedPersistent<v8::Object> m_attributeChangedCallback; 73 ScopedPersistent<v8::Object> m_attributeChangedCallback;
70 HashSet<AtomicString> m_observedAttributes; 74 HashSet<AtomicString> m_observedAttributes;
71 }; 75 };
72 76
73 } // namespace blink 77 } // namespace blink
74 78
75 #endif // ScriptCustomElementDefinition_h 79 #endif // ScriptCustomElementDefinition_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698