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

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

Issue 2828643002: Make customElements.define faster
Patch Set: Remove some unneeded casts. Created 3 years, 7 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 #include "core/dom/custom/CustomElementDefinition.h" 5 #include "core/dom/custom/CustomElementDefinition.h"
6 6
7 #include "core/dom/Attr.h" 7 #include "core/dom/Attr.h"
8 #include "core/dom/ExceptionCode.h" 8 #include "core/dom/ExceptionCode.h"
9 #include "core/dom/custom/CustomElement.h" 9 #include "core/dom/custom/CustomElement.h"
10 #include "core/dom/custom/CustomElementAdoptedCallbackReaction.h" 10 #include "core/dom/custom/CustomElementAdoptedCallbackReaction.h"
11 #include "core/dom/custom/CustomElementAttributeChangedCallbackReaction.h" 11 #include "core/dom/custom/CustomElementAttributeChangedCallbackReaction.h"
12 #include "core/dom/custom/CustomElementConnectedCallbackReaction.h" 12 #include "core/dom/custom/CustomElementConnectedCallbackReaction.h"
13 #include "core/dom/custom/CustomElementDisconnectedCallbackReaction.h" 13 #include "core/dom/custom/CustomElementDisconnectedCallbackReaction.h"
14 #include "core/dom/custom/CustomElementReaction.h" 14 #include "core/dom/custom/CustomElementReaction.h"
15 #include "core/dom/custom/CustomElementReactionStack.h" 15 #include "core/dom/custom/CustomElementReactionStack.h"
16 #include "core/dom/custom/CustomElementUpgradeReaction.h" 16 #include "core/dom/custom/CustomElementUpgradeReaction.h"
17 #include "core/html/HTMLElement.h" 17 #include "core/html/HTMLElement.h"
18 18
19 namespace blink { 19 namespace blink {
20 20
21 CustomElementDefinition::CustomElementDefinition( 21 CustomElementDefinition::CustomElementDefinition(
22 const CustomElementDescriptor& descriptor) 22 const CustomElementDescriptor& descriptor)
23 : descriptor_(descriptor) {} 23 : descriptor_(descriptor) {}
24 24
25 CustomElementDefinition::CustomElementDefinition( 25 CustomElementDefinition::CustomElementDefinition(
26 const CustomElementDescriptor& descriptor, 26 const CustomElementDescriptor& descriptor,
27 const HashSet<AtomicString>& observed_attributes) 27 HashSet<AtomicString>&& observed_attributes)
28 : descriptor_(descriptor), 28 : descriptor_(descriptor),
29 observed_attributes_(observed_attributes), 29 observed_attributes_(observed_attributes),
30 has_style_attribute_changed_callback_( 30 has_style_attribute_changed_callback_(
31 observed_attributes.Contains(HTMLNames::styleAttr.LocalName())) {} 31 observed_attributes_.Contains(HTMLNames::styleAttr.LocalName())) {}
32 32
33 CustomElementDefinition::~CustomElementDefinition() {} 33 CustomElementDefinition::~CustomElementDefinition() {}
34 34
35 DEFINE_TRACE(CustomElementDefinition) { 35 DEFINE_TRACE(CustomElementDefinition) {
36 visitor->Trace(construction_stack_); 36 visitor->Trace(construction_stack_);
37 } 37 }
38 38
39 static String ErrorMessageForConstructorResult(Element* element, 39 static String ErrorMessageForConstructorResult(Element* element,
40 Document& document, 40 Document& document,
41 const QualifiedName& tag_name) { 41 const QualifiedName& tag_name) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 element->SynchronizeAttribute(name); 211 element->SynchronizeAttribute(name);
212 for (const auto& attribute : element->AttributesWithoutUpdate()) { 212 for (const auto& attribute : element->AttributesWithoutUpdate()) {
213 if (HasAttributeChangedCallback(attribute.GetName())) { 213 if (HasAttributeChangedCallback(attribute.GetName())) {
214 EnqueueAttributeChangedCallback(element, attribute.GetName(), g_null_atom, 214 EnqueueAttributeChangedCallback(element, attribute.GetName(), g_null_atom,
215 attribute.Value()); 215 attribute.Value());
216 } 216 }
217 } 217 }
218 } 218 }
219 219
220 } // namespace blink 220 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698