| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |