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

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

Issue 106903007: Let unresolved custom element go through CustomElementCallbackQueue. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated test. Landing again. Created 6 years, 12 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 RefPtr<CustomElementDefinition> definition(passDefinition); 94 RefPtr<CustomElementDefinition> definition(passDefinition);
95 95
96 switch (element->customElementState()) { 96 switch (element->customElementState()) {
97 case Element::NotCustomElement: 97 case Element::NotCustomElement:
98 case Element::Upgraded: 98 case Element::Upgraded:
99 ASSERT_NOT_REACHED(); 99 ASSERT_NOT_REACHED();
100 break; 100 break;
101 101
102 case Element::WaitingForUpgrade: 102 case Element::WaitingForUpgrade:
103 definitions().add(element, definition); 103 definitions().add(element, definition);
104 CustomElementCallbackScheduler::scheduleCreatedCallback(definition->call backs(), element); 104 if (element->inDocument() && element->document().domWindow())
105 CustomElementCallbackScheduler::scheduleAttachedCallback(definition- >callbacks(), element);
106 definition->callbacks()->created(element);
105 break; 107 break;
106 } 108 }
107 } 109 }
108 110
109 CustomElementDefinition* CustomElement::definitionFor(Element* element) 111 CustomElementDefinition* CustomElement::definitionFor(Element* element)
110 { 112 {
111 CustomElementDefinition* definition = definitions().get(element); 113 CustomElementDefinition* definition = definitions().get(element);
112 ASSERT(definition); 114 ASSERT(definition);
113 return definition; 115 return definition;
114 } 116 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 ASSERT_UNUSED(result, result.isNewEntry); 159 ASSERT_UNUSED(result, result.isNewEntry);
158 } 160 }
159 161
160 CustomElement::DefinitionMap& CustomElement::definitions() 162 CustomElement::DefinitionMap& CustomElement::definitions()
161 { 163 {
162 DEFINE_STATIC_LOCAL(DefinitionMap, map, ()); 164 DEFINE_STATIC_LOCAL(DefinitionMap, map, ());
163 return map; 165 return map;
164 } 166 }
165 167
166 } // namespace WebCore 168 } // 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