| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |