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

Unified Diff: sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp

Issue 831993005: Remove custom element type extensions. (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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
diff --git a/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp b/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
index 0ac38e34ad9f15ebc14d74700e746177a68c58f3..af6c9b290e0411343d6f122a51156028740a03fb 100644
--- a/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
+++ b/sky/engine/core/dom/custom/CustomElementRegistrationContext.cpp
@@ -71,25 +71,13 @@ PassRefPtr<Element> CustomElementRegistrationContext::createCustomTagElement(Doc
RefPtr<Element> element = HTMLElement::create(tagName, document);
element->setCustomElementState(Element::WaitingForUpgrade);
- resolveOrScheduleResolution(element.get(), nullAtom);
+ resolveOrScheduleResolution(element.get());
return element.release();
}
-void CustomElementRegistrationContext::didGiveTypeExtension(Element* element, const AtomicString& type)
+void CustomElementRegistrationContext::resolveOrScheduleResolution(Element* element)
{
- resolveOrScheduleResolution(element, type);
-}
-
-void CustomElementRegistrationContext::resolveOrScheduleResolution(Element* element, const AtomicString& typeExtension)
-{
- // If an element has a custom tag name it takes precedence over
- // the "is" attribute (if any).
- const AtomicString& type = CustomElement::isValidName(element->localName())
- ? element->localName()
- : typeExtension;
- ASSERT(!type.isNull());
-
- CustomElementDescriptor descriptor(type, element->localName());
+ CustomElementDescriptor descriptor(element->localName());
ASSERT(element->customElementState() == Element::WaitingForUpgrade);
CustomElementScheduler::resolveOrScheduleResolution(this, element, descriptor);
@@ -106,42 +94,4 @@ void CustomElementRegistrationContext::resolve(Element* element, const CustomEle
}
}
-void CustomElementRegistrationContext::setIsAttributeAndTypeExtension(Element* element, const AtomicString& type)
-{
- ASSERT(element);
- ASSERT(!type.isEmpty());
- element->setAttribute(HTMLNames::isAttr, type);
- setTypeExtension(element, type);
-}
-
-void CustomElementRegistrationContext::setTypeExtension(Element* element, const AtomicString& type)
-{
- if (!element->isHTMLElement())
- return;
-
- CustomElementRegistrationContext* context = element->document().registrationContext();
- if (!context)
- return;
-
- if (element->isCustomElement()) {
- // This can happen if:
- // 1. The element has a custom tag, which takes precedence over
- // type extensions.
- // 2. Undoing a command (eg ReplaceNodeWithSpan) recycles an
- // element but tries to overwrite its attribute list.
- return;
- }
-
- // Custom tags take precedence over type extensions
- ASSERT(!CustomElement::isValidName(element->localName()));
-
- if (!CustomElement::isValidName(type))
- return;
-
- element->setCustomElementState(Element::WaitingForUpgrade);
- // FIXME(sky) this used to call Document::convertLocalName(type) which
- // would lowercase if Document was HTML, that made no sense.
- context->didGiveTypeExtension(element, type);
-}
-
} // namespace blink
« no previous file with comments | « sky/engine/core/dom/custom/CustomElementRegistrationContext.h ('k') | sky/engine/core/dom/custom/CustomElementRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698