mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibWeb: Return HTMLElement for valid custom element tag names
This commit is contained in:
parent
f2dd878fe7
commit
47a466865c
Notes:
sideshowbarker
2024-07-17 04:32:07 +09:00
Author: https://github.com/srikavin Commit: https://github.com/SerenityOS/serenity/commit/47a466865c Pull-request: https://github.com/SerenityOS/serenity/pull/18005 Reviewed-by: https://github.com/trflynn89
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/HTML/CustomElements/CustomElementName.h>
|
||||
#include <LibWeb/HTML/HTMLAnchorElement.h>
|
||||
#include <LibWeb/HTML/HTMLAreaElement.h>
|
||||
#include <LibWeb/HTML/HTMLAudioElement.h>
|
||||
|
@ -291,8 +292,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> create_element(Document& document
|
|||
if (lowercase_tag_name == SVG::TagNames::text)
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGTextContentElement>(realm, document, move(qualified_name)));
|
||||
|
||||
// FIXME: If name is a valid custom element name, then return HTMLElement.
|
||||
|
||||
// If name is a valid custom element name, then return HTMLElement.
|
||||
if (HTML::is_valid_custom_element_name(local_name)) {
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<HTML::HTMLElement>(realm, document, move(qualified_name)));
|
||||
}
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<HTML::HTMLUnknownElement>(realm, document, move(qualified_name)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue