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

Side by Side Diff: sky/engine/core/dom/custom/CustomElementRegistry.cpp

Issue 788773006: Remove extension check from CustomElementRegistry. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « sky/engine/core/dom/custom/CustomElementException.cpp ('k') | no next file » | 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) 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 CustomElementDefinition* CustomElementRegistry::registerElement(Document* docume nt, CustomElementConstructorBuilder* constructorBuilder, const AtomicString& use rSuppliedName, CustomElement::NameSet validNames, ExceptionState& exceptionState ) 62 CustomElementDefinition* CustomElementRegistry::registerElement(Document* docume nt, CustomElementConstructorBuilder* constructorBuilder, const AtomicString& use rSuppliedName, CustomElement::NameSet validNames, ExceptionState& exceptionState )
63 { 63 {
64 // FIXME: In every instance except one it is the 64 // FIXME: In every instance except one it is the
65 // CustomElementConstructorBuilder that observes document 65 // CustomElementConstructorBuilder that observes document
66 // destruction during registration. This responsibility should be 66 // destruction during registration. This responsibility should be
67 // consolidated in one place. 67 // consolidated in one place.
68 RegistrationContextObserver observer(document); 68 RegistrationContextObserver observer(document);
69 69
70 AtomicString type = userSuppliedName.lower(); 70 AtomicString type = userSuppliedName.lower();
71 71
72 if (!constructorBuilder->isFeatureAllowed()) {
73 CustomElementException::throwException(CustomElementException::CannotReg isterFromExtension, type, exceptionState);
74 return 0;
75 }
76
77 if (!CustomElement::isValidName(type, validNames)) { 72 if (!CustomElement::isValidName(type, validNames)) {
78 CustomElementException::throwException(CustomElementException::InvalidNa me, type, exceptionState); 73 CustomElementException::throwException(CustomElementException::InvalidNa me, type, exceptionState);
79 return 0; 74 return 0;
80 } 75 }
81 76
82 if (m_definitions.contains(type)) { 77 if (m_definitions.contains(type)) {
83 CustomElementException::throwException(CustomElementException::TypeAlrea dyRegistered, type, exceptionState); 78 CustomElementException::throwException(CustomElementException::TypeAlrea dyRegistered, type, exceptionState);
84 return 0; 79 return 0;
85 } 80 }
86 81
(...skipping 27 matching lines...) Expand all
114 109
115 return definition.get(); 110 return definition.get();
116 } 111 }
117 112
118 CustomElementDefinition* CustomElementRegistry::find(const CustomElementDescript or& descriptor) const 113 CustomElementDefinition* CustomElementRegistry::find(const CustomElementDescript or& descriptor) const
119 { 114 {
120 return m_definitions.get(descriptor); 115 return m_definitions.get(descriptor);
121 } 116 }
122 117
123 } // namespace blink 118 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/custom/CustomElementException.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698