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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp

Issue 2502223002: Custom Elements: The 'is' Attribute Should Not Be Specified on an Autonomous Custom Element (Closed)
Patch Set: edits made to follow specs more closely Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/custom-elements/spec/create-element.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp
index 3e4500166cbf47f1a43ffd76d75844346638b1a7..4d3cc4ae6f05aa9b8a19676f9ee52f0c2c5ebd8a 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementRegistry.cpp
@@ -214,12 +214,16 @@ ScriptValue CustomElementRegistry::get(const AtomicString& name) {
// At this point, what the spec calls 'is' is 'name' from desc
CustomElementDefinition* CustomElementRegistry::definitionFor(
const CustomElementDescriptor& desc) const {
- // 4&5. If there is a definition in registry with name equal to is/localName
- // Autonomous elements have the same name and local name
- CustomElementDefinition* definition = definitionForName(desc.name());
- // 4&5. and name equal to localName, return that definition
- if (definition and definition->descriptor().localName() == desc.localName())
+ // desc.name() is 'is' attribute
+ // 4. If definition in registry with name equal to local name...
+ CustomElementDefinition* definition = definitionForName(desc.localName());
+ // 5. If definition in registry with name equal to name...
+ if (!definition)
+ definition = definitionForName(desc.name());
+ // 4&5. ...and local name equal to localName, return that definition
+ if (definition and definition->descriptor().localName() == desc.localName()) {
return definition;
+ }
// 6. Return null
return nullptr;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/custom-elements/spec/create-element.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698