mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:08:12 +00:00
LibWeb: Add HTML elements to factories, add missing tags and attributes
This is mostly to get the grunt work of the way. This is split up into multiple commits to hopefully make it more manageable to review. Note that these are not full implementations, and the bindings mostly get the low hanging fruit. Also implements some attributes that I kept out because they had dashes in them. Therefore, this closes #2905.
This commit is contained in:
parent
be5a62d5d7
commit
5724ac8e72
13 changed files with 656 additions and 54 deletions
|
@ -2,5 +2,6 @@ interface HTMLFormElement : HTMLElement {
|
|||
|
||||
[Reflect] attribute DOMString name;
|
||||
[Reflect] attribute DOMString rel;
|
||||
[Reflect=accept-charset] attribute DOMString acceptCharset;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,5 +2,6 @@ interface HTMLMetaElement : HTMLElement {
|
|||
|
||||
[Reflect] attribute DOMString name;
|
||||
[Reflect] attribute DOMString content;
|
||||
[Reflect=http-equiv] attribute DOMString httpEquiv;
|
||||
|
||||
}
|
||||
|
|
|
@ -41,5 +41,5 @@ public:
|
|||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTML::HTMLPreElement)
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTML::HTMLElement>(node).local_name().is_one_of(Web::HTML::TagNames::pre, Web::HTML::TagNames::listing, Web::HTML::TagNames::xmp); }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element() && downcast<Web::HTML::HTMLElement>(node).local_name() == Web::HTML::TagNames::pre; }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
|
@ -36,12 +36,13 @@ public:
|
|||
|
||||
HTMLUnknownElement(DOM::Document&, const FlyString& local_name);
|
||||
virtual ~HTMLUnknownElement() override;
|
||||
|
||||
private:
|
||||
virtual bool is_unknown_html_element() const final { return true; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
AK_BEGIN_TYPE_TRAITS(Web::HTML::HTMLUnknownElement)
|
||||
// FIXME: I'm not sure what the check for this should be.
|
||||
// There are some elements which are explicitly mapped to HTMLUnknownElement, but other than that, it's for, well, unknown elements.
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_html_element(); }
|
||||
static bool is_type(const Web::DOM::Node& node) { return node.is_unknown_html_element(); }
|
||||
AK_END_TYPE_TRAITS()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue