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

Side by Side Diff: Source/core/dom/CustomElementRegistry.cpp

Issue 19002005: Share Custom Element registration contexts between related documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Tweak the test to do lazy wrapping in both cases. Created 7 years, 5 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
OLDNEW
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.nam espaceURI() == SVGNames::svgNamespaceURI); 86 ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.nam espaceURI() == SVGNames::svgNamespaceURI);
87 87
88 if (m_registeredTypeNames.contains(type)) { 88 if (m_registeredTypeNames.contains(type)) {
89 ec = InvalidStateError; 89 ec = InvalidStateError;
90 return 0; 90 return 0;
91 } 91 }
92 92
93 ASSERT(!observer.registrationContextWentAway()); 93 ASSERT(!observer.registrationContextWentAway());
94 94
95 RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuil der->createCallbacks(document); 95 RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuil der->createCallbacks();
96 96
97 // Consulting the constructor builder could execute script and 97 // Consulting the constructor builder could execute script and
98 // kill the document. 98 // kill the document.
99 if (observer.registrationContextWentAway()) { 99 if (observer.registrationContextWentAway()) {
100 ec = InvalidStateError; 100 ec = InvalidStateError;
101 return 0; 101 return 0;
102 } 102 }
103 103
104 const CustomElementDescriptor descriptor(type, tagName.namespaceURI(), tagNa me.localName()); 104 const CustomElementDescriptor descriptor(type, tagName.namespaceURI(), tagNa me.localName());
105 RefPtr<CustomElementDefinition> definition = CustomElementDefinition::create (descriptor, lifecycleCallbacks); 105 RefPtr<CustomElementDefinition> definition = CustomElementDefinition::create (descriptor, lifecycleCallbacks);
(...skipping 13 matching lines...) Expand all
119 119
120 return definition.get(); 120 return definition.get();
121 } 121 }
122 122
123 CustomElementDefinition* CustomElementRegistry::find(const CustomElementDescript or& descriptor) const 123 CustomElementDefinition* CustomElementRegistry::find(const CustomElementDescript or& descriptor) const
124 { 124 {
125 return m_definitions.get(descriptor); 125 return m_definitions.get(descriptor);
126 } 126 }
127 127
128 } // namespace WebCore 128 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/CustomElementRegistrationContextualizer.cpp ('k') | Source/core/dom/DOMImplementation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698