| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuil
der->createCallbacks(); | 88 RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuil
der->createCallbacks(); |
| 89 | 89 |
| 90 // Consulting the constructor builder could execute script and | 90 // Consulting the constructor builder could execute script and |
| 91 // kill the document. | 91 // kill the document. |
| 92 if (observer.registrationContextWentAway()) { | 92 if (observer.registrationContextWentAway()) { |
| 93 CustomElementException::throwException(CustomElementException::ContextDe
stroyedCreatingCallbacks, type, exceptionState); | 93 CustomElementException::throwException(CustomElementException::ContextDe
stroyedCreatingCallbacks, type, exceptionState); |
| 94 return 0; | 94 return 0; |
| 95 } | 95 } |
| 96 | 96 |
| 97 const CustomElementDescriptor descriptor(tagName.localName()); | 97 RefPtr<CustomElementDefinition> definition = CustomElementDefinition::create
(tagName.localName(), lifecycleCallbacks); |
| 98 RefPtr<CustomElementDefinition> definition = CustomElementDefinition::create
(descriptor, lifecycleCallbacks); | |
| 99 | 98 |
| 100 if (!constructorBuilder->createConstructor(document, definition.get(), excep
tionState)) | 99 if (!constructorBuilder->createConstructor(document, definition.get(), excep
tionState)) |
| 101 return 0; | 100 return 0; |
| 102 | 101 |
| 103 m_definitions.add(descriptor, definition); | 102 m_definitions.add(tagName.localName(), definition); |
| 104 | 103 |
| 105 if (!constructorBuilder->didRegisterDefinition(definition.get())) { | 104 if (!constructorBuilder->didRegisterDefinition(definition.get())) { |
| 106 CustomElementException::throwException(CustomElementException::ContextDe
stroyedRegisteringDefinition, type, exceptionState); | 105 CustomElementException::throwException(CustomElementException::ContextDe
stroyedRegisteringDefinition, type, exceptionState); |
| 107 return 0; | 106 return 0; |
| 108 } | 107 } |
| 109 | 108 |
| 110 return definition.get(); | 109 return definition.get(); |
| 111 } | 110 } |
| 112 | 111 |
| 113 CustomElementDefinition* CustomElementRegistry::find(const CustomElementDescript
or& descriptor) const | 112 CustomElementDefinition* CustomElementRegistry::find(const AtomicString& localNa
me) const |
| 114 { | 113 { |
| 115 return m_definitions.get(descriptor); | 114 return m_definitions.get(localName); |
| 116 } | 115 } |
| 117 | 116 |
| 118 } // namespace blink | 117 } // namespace blink |
| OLD | NEW |