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

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

Issue 144023016: Separate Custom Element resolution and upgrade/createdCallback. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/core.gypi ('k') | Source/core/dom/custom/CustomElementCallbackInvocation.h » ('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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 RefPtr<CustomElementDefinition> definition(passDefinition); 99 RefPtr<CustomElementDefinition> definition(passDefinition);
100 100
101 switch (element->customElementState()) { 101 switch (element->customElementState()) {
102 case Element::NotCustomElement: 102 case Element::NotCustomElement:
103 case Element::Upgraded: 103 case Element::Upgraded:
104 ASSERT_NOT_REACHED(); 104 ASSERT_NOT_REACHED();
105 break; 105 break;
106 106
107 case Element::WaitingForUpgrade: 107 case Element::WaitingForUpgrade:
108 definitions().add(element, definition); 108 definitions().add(element, definition);
109 if (element->inDocument() && element->document().domWindow()) 109 CustomElementScheduler::scheduleCreatedCallback(definition->callbacks(), element);
110 CustomElementScheduler::scheduleAttachedCallback(definition->callbac ks(), element);
111 // FIXME: Push this through the callback scheduler. That
112 // design makes resolve and define robust to being called
113 // during other operations.
114 definition->callbacks()->created(element);
115 break; 110 break;
116 } 111 }
117 } 112 }
118 113
119 CustomElementDefinition* CustomElement::definitionFor(Element* element) 114 CustomElementDefinition* CustomElement::definitionFor(Element* element)
120 { 115 {
121 CustomElementDefinition* definition = definitions().get(element); 116 CustomElementDefinition* definition = definitions().get(element);
122 ASSERT(definition); 117 ASSERT(definition);
123 return definition; 118 return definition;
124 } 119 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 ASSERT_UNUSED(result, result.isNewEntry); 162 ASSERT_UNUSED(result, result.isNewEntry);
168 } 163 }
169 164
170 CustomElement::DefinitionMap& CustomElement::definitions() 165 CustomElement::DefinitionMap& CustomElement::definitions()
171 { 166 {
172 DEFINE_STATIC_LOCAL(DefinitionMap, map, ()); 167 DEFINE_STATIC_LOCAL(DefinitionMap, map, ());
173 return map; 168 return map;
174 } 169 }
175 170
176 } // namespace WebCore 171 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/custom/CustomElementCallbackInvocation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698