Commit 186df9ec authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Simplify the name of FooElementFactory::CreateRawFooElement().

The name is redundant.

- There are no non-'Raw' version of the function any longer.
- 'Foo' is repeated.
- 'Element' is repeated

So the function name should be just 'Create.'

This CL has no behavior changes.

Change-Id: I5635a39e987dddbdb122bb68958278bab6f852f3
Reviewed-on: https://chromium-review.googlesource.com/920722Reviewed-by: default avatarYoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536981}
parent 33e085fe
...@@ -60,7 +60,7 @@ static void create{{namespace}}FunctionMap() { ...@@ -60,7 +60,7 @@ static void create{{namespace}}FunctionMap() {
g_{{namespace}}_constructors->Set(data[i].tag.LocalName(), data[i].func); g_{{namespace}}_constructors->Set(data[i].tag.LocalName(), data[i].func);
} }
{{namespace}}Element* {{namespace}}ElementFactory::CreateRaw{{namespace}}Element( {{namespace}}Element* {{namespace}}ElementFactory::Create(
const AtomicString& localName, const AtomicString& localName,
Document& document, Document& document,
const CreateElementFlags flags) { const CreateElementFlags flags) {
......
...@@ -17,7 +17,7 @@ class {{namespace}}Element; ...@@ -17,7 +17,7 @@ class {{namespace}}Element;
class {{namespace}}ElementFactory { class {{namespace}}ElementFactory {
public: public:
// If |localName| is unknown, nullptr is returned. // If |localName| is unknown, nullptr is returned.
static {{namespace}}Element* CreateRaw{{namespace}}Element( static {{namespace}}Element* Create(
const AtomicString& localName, const AtomicString& localName,
Document&, Document&,
const CreateElementFlags flags); const CreateElementFlags flags);
......
...@@ -864,8 +864,7 @@ Element* Document::CreateRawElement(const QualifiedName& qname, ...@@ -864,8 +864,7 @@ Element* Document::CreateRawElement(const QualifiedName& qname,
Element* element = nullptr; Element* element = nullptr;
if (qname.NamespaceURI() == HTMLNames::xhtmlNamespaceURI) { if (qname.NamespaceURI() == HTMLNames::xhtmlNamespaceURI) {
// https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom:element-interface // https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom:element-interface
element = HTMLElementFactory::CreateRawHTMLElement(qname.LocalName(), *this, element = HTMLElementFactory::Create(qname.LocalName(), *this, flags);
flags);
if (!element) { if (!element) {
// 6. If name is a valid custom element name, then return // 6. If name is a valid custom element name, then return
// HTMLElement. // HTMLElement.
...@@ -877,8 +876,7 @@ Element* Document::CreateRawElement(const QualifiedName& qname, ...@@ -877,8 +876,7 @@ Element* Document::CreateRawElement(const QualifiedName& qname,
} }
saw_elements_in_known_namespaces_ = true; saw_elements_in_known_namespaces_ = true;
} else if (qname.NamespaceURI() == SVGNames::svgNamespaceURI) { } else if (qname.NamespaceURI() == SVGNames::svgNamespaceURI) {
element = element = SVGElementFactory::Create(qname.LocalName(), *this, flags);
SVGElementFactory::CreateRawSVGElement(qname.LocalName(), *this, flags);
if (!element) if (!element)
element = SVGUnknownElement::Create(qname, *this); element = SVGUnknownElement::Create(qname, *this);
saw_elements_in_known_namespaces_ = true; saw_elements_in_known_namespaces_ = true;
...@@ -913,7 +911,7 @@ Element* Document::CreateElementForBinding(const AtomicString& name, ...@@ -913,7 +911,7 @@ Element* Document::CreateElementForBinding(const AtomicString& name,
QualifiedName(g_null_atom, local_name, HTMLNames::xhtmlNamespaceURI), QualifiedName(g_null_atom, local_name, HTMLNames::xhtmlNamespaceURI),
CreateElementFlags::ByCreateElement()); CreateElementFlags::ByCreateElement());
} }
if (Element* element = HTMLElementFactory::CreateRawHTMLElement( if (auto* element = HTMLElementFactory::Create(
local_name, *this, CreateElementFlags::ByCreateElement())) local_name, *this, CreateElementFlags::ByCreateElement()))
return element; return element;
QualifiedName q_name(g_null_atom, local_name, HTMLNames::xhtmlNamespaceURI); QualifiedName q_name(g_null_atom, local_name, HTMLNames::xhtmlNamespaceURI);
......
...@@ -92,9 +92,9 @@ void CustomElementDefinition::CheckConstructorResult( ...@@ -92,9 +92,9 @@ void CustomElementDefinition::CheckConstructorResult(
HTMLElement* CustomElementDefinition::CreateElementForConstructor( HTMLElement* CustomElementDefinition::CreateElementForConstructor(
Document& document) { Document& document) {
HTMLElement* element = HTMLElementFactory::CreateRawHTMLElement( HTMLElement* element =
Descriptor().LocalName(), document, HTMLElementFactory::Create(Descriptor().LocalName(), document,
CreateElementFlags::ByCreateElement()); CreateElementFlags::ByCreateElement());
if (!element) { if (!element) {
element = element =
HTMLElement::Create(QualifiedName(g_null_atom, Descriptor().LocalName(), HTMLElement::Create(QualifiedName(g_null_atom, Descriptor().LocalName(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment