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() {
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,
Document& document,
const CreateElementFlags flags) {
......
......@@ -17,7 +17,7 @@ class {{namespace}}Element;
class {{namespace}}ElementFactory {
public:
// If |localName| is unknown, nullptr is returned.
static {{namespace}}Element* CreateRaw{{namespace}}Element(
static {{namespace}}Element* Create(
const AtomicString& localName,
Document&,
const CreateElementFlags flags);
......
......@@ -864,8 +864,7 @@ Element* Document::CreateRawElement(const QualifiedName& qname,
Element* element = nullptr;
if (qname.NamespaceURI() == HTMLNames::xhtmlNamespaceURI) {
// https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom:element-interface
element = HTMLElementFactory::CreateRawHTMLElement(qname.LocalName(), *this,
flags);
element = HTMLElementFactory::Create(qname.LocalName(), *this, flags);
if (!element) {
// 6. If name is a valid custom element name, then return
// HTMLElement.
......@@ -877,8 +876,7 @@ Element* Document::CreateRawElement(const QualifiedName& qname,
}
saw_elements_in_known_namespaces_ = true;
} else if (qname.NamespaceURI() == SVGNames::svgNamespaceURI) {
element =
SVGElementFactory::CreateRawSVGElement(qname.LocalName(), *this, flags);
element = SVGElementFactory::Create(qname.LocalName(), *this, flags);
if (!element)
element = SVGUnknownElement::Create(qname, *this);
saw_elements_in_known_namespaces_ = true;
......@@ -913,7 +911,7 @@ Element* Document::CreateElementForBinding(const AtomicString& name,
QualifiedName(g_null_atom, local_name, HTMLNames::xhtmlNamespaceURI),
CreateElementFlags::ByCreateElement());
}
if (Element* element = HTMLElementFactory::CreateRawHTMLElement(
if (auto* element = HTMLElementFactory::Create(
local_name, *this, CreateElementFlags::ByCreateElement()))
return element;
QualifiedName q_name(g_null_atom, local_name, HTMLNames::xhtmlNamespaceURI);
......
......@@ -92,9 +92,9 @@ void CustomElementDefinition::CheckConstructorResult(
HTMLElement* CustomElementDefinition::CreateElementForConstructor(
Document& document) {
HTMLElement* element = HTMLElementFactory::CreateRawHTMLElement(
Descriptor().LocalName(), document,
CreateElementFlags::ByCreateElement());
HTMLElement* element =
HTMLElementFactory::Create(Descriptor().LocalName(), document,
CreateElementFlags::ByCreateElement());
if (!element) {
element =
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