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

Side by Side Diff: Source/core/dom/CustomElement.cpp

Issue 23523012: Have CustomElement::didEnterDocument() / didLeaveDocument() take a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/CustomElement.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (CustomElementDefinition* definition = definitions().get(element)) 125 if (CustomElementDefinition* definition = definitions().get(element))
126 CustomElementCallbackScheduler::scheduleCreatedCallback(definition->call backs(), element); 126 CustomElementCallbackScheduler::scheduleCreatedCallback(definition->call backs(), element);
127 } 127 }
128 128
129 void CustomElement::attributeDidChange(Element* element, const AtomicString& nam e, const AtomicString& oldValue, const AtomicString& newValue) 129 void CustomElement::attributeDidChange(Element* element, const AtomicString& nam e, const AtomicString& oldValue, const AtomicString& newValue)
130 { 130 {
131 ASSERT(element->customElementState() == Element::Upgraded); 131 ASSERT(element->customElementState() == Element::Upgraded);
132 CustomElementCallbackScheduler::scheduleAttributeChangedCallback(definitionF or(element)->callbacks(), element, name, oldValue, newValue); 132 CustomElementCallbackScheduler::scheduleAttributeChangedCallback(definitionF or(element)->callbacks(), element, name, oldValue, newValue);
133 } 133 }
134 134
135 void CustomElement::didEnterDocument(Element* element, Document* document) 135 void CustomElement::didEnterDocument(Element* element, const Document& document)
136 { 136 {
137 ASSERT(element->customElementState() == Element::Upgraded); 137 ASSERT(element->customElementState() == Element::Upgraded);
138 if (!document->defaultView()) 138 if (!document.defaultView())
139 return; 139 return;
140 CustomElementCallbackScheduler::scheduleEnteredDocumentCallback(definitionFo r(element)->callbacks(), element); 140 CustomElementCallbackScheduler::scheduleEnteredDocumentCallback(definitionFo r(element)->callbacks(), element);
141 } 141 }
142 142
143 void CustomElement::didLeaveDocument(Element* element, Document* document) 143 void CustomElement::didLeaveDocument(Element* element, const Document& document)
144 { 144 {
145 ASSERT(element->customElementState() == Element::Upgraded); 145 ASSERT(element->customElementState() == Element::Upgraded);
146 if (!document->defaultView()) 146 if (!document.defaultView())
147 return; 147 return;
148 CustomElementCallbackScheduler::scheduleLeftDocumentCallback(definitionFor(e lement)->callbacks(), element); 148 CustomElementCallbackScheduler::scheduleLeftDocumentCallback(definitionFor(e lement)->callbacks(), element);
149 } 149 }
150 150
151 void CustomElement::wasDestroyed(Element* element) 151 void CustomElement::wasDestroyed(Element* element)
152 { 152 {
153 switch (element->customElementState()) { 153 switch (element->customElementState()) {
154 case Element::NotCustomElement: 154 case Element::NotCustomElement:
155 ASSERT_NOT_REACHED(); 155 ASSERT_NOT_REACHED();
156 break; 156 break;
(...skipping 14 matching lines...) Expand all
171 ASSERT(result.isNewEntry); 171 ASSERT(result.isNewEntry);
172 } 172 }
173 173
174 CustomElement::DefinitionMap& CustomElement::definitions() 174 CustomElement::DefinitionMap& CustomElement::definitions()
175 { 175 {
176 DEFINE_STATIC_LOCAL(DefinitionMap, map, ()); 176 DEFINE_STATIC_LOCAL(DefinitionMap, map, ());
177 return map; 177 return map;
178 } 178 }
179 179
180 } // namespace WebCore 180 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElement.h ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698