2020-01-18 09:38:21 +01:00
/*
2023-02-20 18:56:08 +01:00
* Copyright ( c ) 2018 - 2023 , Andreas Kling < kling @ serenityos . org >
2020-01-18 09:38:21 +01:00
*
2021-04-22 01:24:48 -07:00
* SPDX - License - Identifier : BSD - 2 - Clause
2020-01-18 09:38:21 +01:00
*/
2019-06-15 18:55:47 +02:00
# pragma once
2023-01-08 19:23:00 -05:00
# include <AK/DeprecatedFlyString.h>
2022-12-04 18:02:33 +00:00
# include <AK/DeprecatedString.h>
2023-01-28 22:23:16 +00:00
# include <LibWeb/ARIA/ARIAMixin.h>
2022-10-04 19:52:25 +02:00
# include <LibWeb/Bindings/ElementPrototype.h>
2023-01-28 20:37:46 +01:00
# include <LibWeb/Bindings/ShadowRootPrototype.h>
2023-03-06 20:53:49 +00:00
# include <LibWeb/Bindings/WindowGlobalMixin.h>
2021-05-28 21:21:44 +02:00
# include <LibWeb/CSS/CSSStyleDeclaration.h>
2022-09-18 01:03:58 +02:00
# include <LibWeb/DOM/Attr.h>
2021-09-29 16:25:48 +01:00
# include <LibWeb/DOM/ChildNode.h>
2021-10-16 16:16:57 -04:00
# include <LibWeb/DOM/NamedNodeMap.h>
2020-08-03 20:30:02 +02:00
# include <LibWeb/DOM/NonDocumentTypeChildNode.h>
2020-03-07 10:32:51 +01:00
# include <LibWeb/DOM/ParentNode.h>
2022-02-18 20:52:47 +01:00
# include <LibWeb/DOM/QualifiedName.h>
2020-08-12 14:46:53 +02:00
# include <LibWeb/HTML/AttributeNames.h>
2021-09-09 00:59:09 +02:00
# include <LibWeb/HTML/EventLoop/Task.h>
2020-12-13 17:54:40 +01:00
# include <LibWeb/HTML/TagNames.h>
2023-03-06 20:53:49 +00:00
# include <LibWeb/HTML/Window.h>
2020-11-22 15:53:01 +01:00
# include <LibWeb/Layout/Node.h>
2022-03-03 17:50:12 +00:00
# include <LibWeb/Layout/TreeBuilder.h>
2022-09-25 17:03:42 +01:00
# include <LibWeb/WebIDL/ExceptionOr.h>
2019-10-14 18:32:02 +02:00
2020-07-26 19:37:56 +02:00
namespace Web : : DOM {
2019-06-15 18:55:47 +02:00
2023-01-28 20:37:46 +01:00
struct ShadowRootInit {
Bindings : : ShadowRootMode mode ;
bool delegates_focus = false ;
} ;
2022-10-04 19:52:25 +02:00
// https://w3c.github.io/csswg-drafts/cssom-view-1/#dictdef-scrollintoviewoptions
2023-03-06 20:53:49 +00:00
struct ScrollIntoViewOptions : public HTML : : ScrollOptions {
2022-10-04 19:52:25 +02:00
Bindings : : ScrollLogicalPosition block { Bindings : : ScrollLogicalPosition : : Start } ;
Bindings : : ScrollLogicalPosition inline_ { Bindings : : ScrollLogicalPosition : : Nearest } ;
} ;
2023-03-29 23:46:18 +01:00
// https://html.spec.whatwg.org/multipage/custom-elements.html#upgrade-reaction
// An upgrade reaction, which will upgrade the custom element and contains a custom element definition; or
struct CustomElementUpgradeReaction {
JS : : Handle < HTML : : CustomElementDefinition > custom_element_definition ;
} ;
// https://html.spec.whatwg.org/multipage/custom-elements.html#callback-reaction
// A callback reaction, which will call a lifecycle callback, and contains a callback function as well as a list of arguments.
struct CustomElementCallbackReaction {
JS : : Handle < WebIDL : : CallbackType > callback ;
JS : : MarkedVector < JS : : Value > arguments ;
} ;
// https://dom.spec.whatwg.org/#concept-element-custom-element-state
// An element’ s custom element state is one of "undefined", "failed", "uncustomized", "precustomized", or "custom".
enum class CustomElementState {
Undefined ,
Failed ,
Uncustomized ,
Precustomized ,
Custom ,
} ;
2020-08-03 20:30:02 +02:00
class Element
: public ParentNode
2021-09-29 16:25:48 +01:00
, public ChildNode < Element >
2022-11-28 17:58:13 -06:00
, public NonDocumentTypeChildNode < Element >
2023-01-28 22:23:16 +00:00
, public ARIA : : ARIAMixin {
2022-08-28 13:42:07 +02:00
WEB_PLATFORM_OBJECT ( Element , ParentNode ) ;
2020-08-03 20:30:02 +02:00
2019-06-15 18:55:47 +02:00
public :
virtual ~ Element ( ) override ;
2022-12-04 18:02:33 +00:00
DeprecatedString const & qualified_name ( ) const { return m_qualified_name . as_string ( ) ; }
DeprecatedString const & html_uppercased_qualified_name ( ) const { return m_html_uppercased_qualified_name ; }
2023-01-08 19:23:00 -05:00
virtual DeprecatedFlyString node_name ( ) const final { return html_uppercased_qualified_name ( ) ; }
DeprecatedFlyString const & local_name ( ) const { return m_qualified_name . local_name ( ) ; }
2020-07-23 18:18:13 +02:00
// NOTE: This is for the JS bindings
2022-12-04 18:02:33 +00:00
DeprecatedString const & tag_name ( ) const { return html_uppercased_qualified_name ( ) ; }
2019-06-15 18:55:47 +02:00
2023-01-08 19:23:00 -05:00
DeprecatedFlyString const & prefix ( ) const { return m_qualified_name . prefix ( ) ; }
2023-03-29 23:46:18 +01:00
void set_prefix ( DeprecatedFlyString const & value ) ;
2023-01-08 19:23:00 -05:00
DeprecatedFlyString const & namespace_ ( ) const { return m_qualified_name . namespace_ ( ) ; }
2020-10-10 02:48:05 +01:00
// NOTE: This is for the JS bindings
2023-01-08 19:23:00 -05:00
DeprecatedFlyString const & namespace_uri ( ) const { return namespace_ ( ) ; }
2020-10-10 02:48:05 +01:00
2023-01-08 19:23:00 -05:00
bool has_attribute ( DeprecatedFlyString const & name ) const ;
2021-10-16 16:16:57 -04:00
bool has_attributes ( ) const { return ! m_attributes - > is_empty ( ) ; }
2023-01-08 19:23:00 -05:00
DeprecatedString attribute ( DeprecatedFlyString const & name ) const { return get_attribute ( name ) ; }
DeprecatedString get_attribute ( DeprecatedFlyString const & name ) const ;
WebIDL : : ExceptionOr < void > set_attribute ( DeprecatedFlyString const & name , DeprecatedString const & value ) ;
WebIDL : : ExceptionOr < void > set_attribute_ns ( DeprecatedFlyString const & namespace_ , DeprecatedFlyString const & qualified_name , DeprecatedString const & value ) ;
2023-03-10 14:56:29 +01:00
WebIDL : : ExceptionOr < JS : : GCPtr < Attr > > set_attribute_node ( Attr & ) ;
WebIDL : : ExceptionOr < JS : : GCPtr < Attr > > set_attribute_node_ns ( Attr & ) ;
2023-01-08 19:23:00 -05:00
void remove_attribute ( DeprecatedFlyString const & name ) ;
WebIDL : : ExceptionOr < bool > toggle_attribute ( DeprecatedFlyString const & name , Optional < bool > force ) ;
2021-10-16 16:16:57 -04:00
size_t attribute_list_size ( ) const { return m_attributes - > length ( ) ; }
2022-08-28 13:42:07 +02:00
NamedNodeMap const * attributes ( ) const { return m_attributes . ptr ( ) ; }
2022-12-04 18:02:33 +00:00
Vector < DeprecatedString > get_attribute_names ( ) const ;
2019-06-15 21:08:36 +02:00
2023-01-08 19:23:00 -05:00
JS : : GCPtr < Attr > get_attribute_node ( DeprecatedFlyString const & name ) const ;
2022-11-05 04:37:40 +00:00
2022-08-08 15:19:46 +02:00
DOMTokenList * class_list ( ) ;
2021-10-18 13:21:23 -04:00
2023-01-28 20:37:46 +01:00
WebIDL : : ExceptionOr < JS : : NonnullGCPtr < ShadowRoot > > attach_shadow ( ShadowRootInit init ) ;
JS : : GCPtr < ShadowRoot > shadow_root ( ) const ;
2022-09-25 17:03:42 +01:00
WebIDL : : ExceptionOr < bool > matches ( StringView selectors ) const ;
WebIDL : : ExceptionOr < DOM : : Element const * > closest ( StringView selectors ) const ;
2021-09-30 02:16:36 +02:00
2021-09-30 02:17:23 +02:00
int client_top ( ) const ;
int client_left ( ) const ;
int client_width ( ) const ;
int client_height ( ) const ;
2019-06-15 21:08:36 +02:00
template < typename Callback >
2019-06-15 22:49:44 +02:00
void for_each_attribute ( Callback callback ) const
2019-06-15 21:08:36 +02:00
{
2021-10-16 16:16:57 -04:00
for ( size_t i = 0 ; i < m_attributes - > length ( ) ; + + i ) {
auto const * attribute = m_attributes - > item ( i ) ;
2021-10-15 09:57:07 -04:00
callback ( attribute - > name ( ) , attribute - > value ( ) ) ;
2021-10-16 16:16:57 -04:00
}
2019-06-15 21:08:36 +02:00
}
2023-03-07 19:54:01 +01:00
bool has_class ( FlyString const & , CaseSensitivity = CaseSensitivity : : CaseSensitive ) const ;
Vector < FlyString > const & class_names ( ) const { return m_classes ; }
2019-06-27 20:40:21 +02:00
2020-07-26 20:01:35 +02:00
virtual void apply_presentational_hints ( CSS : : StyleProperties & ) const { }
2023-01-08 19:23:00 -05:00
virtual void parse_attribute ( DeprecatedFlyString const & name , DeprecatedString const & value ) ;
virtual void did_remove_attribute ( DeprecatedFlyString const & ) ;
2019-10-04 21:05:52 +02:00
2022-03-16 17:48:50 +01:00
enum class NeedsRelayout {
No = 0 ,
Yes = 1 ,
} ;
NeedsRelayout recompute_style ( ) ;
2019-10-14 18:32:02 +02:00
2020-11-22 15:53:01 +01:00
Layout : : NodeWithStyle * layout_node ( ) { return static_cast < Layout : : NodeWithStyle * > ( Node : : layout_node ( ) ) ; }
2022-04-01 20:58:27 +03:00
Layout : : NodeWithStyle const * layout_node ( ) const { return static_cast < Layout : : NodeWithStyle const * > ( Node : : layout_node ( ) ) ; }
2019-10-14 18:32:02 +02:00
2022-12-04 18:02:33 +00:00
DeprecatedString name ( ) const { return attribute ( HTML : : AttributeNames : : name ) ; }
2019-10-20 09:09:15 +02:00
2023-02-20 18:56:08 +01:00
CSS : : StyleProperties * computed_css_values ( ) { return m_computed_css_values . ptr ( ) ; }
2022-03-15 19:41:35 +01:00
CSS : : StyleProperties const * computed_css_values ( ) const { return m_computed_css_values . ptr ( ) ; }
void set_computed_css_values ( RefPtr < CSS : : StyleProperties > style ) { m_computed_css_values = move ( style ) ; }
2022-03-15 19:32:17 +01:00
NonnullRefPtr < CSS : : StyleProperties > resolved_css_values ( ) ;
2020-01-02 14:52:34 +01:00
2022-04-11 16:56:52 +02:00
CSS : : CSSStyleDeclaration const * inline_style ( ) const ;
2020-12-07 19:56:53 +01:00
2022-08-07 16:21:26 +02:00
CSS : : CSSStyleDeclaration * style_for_bindings ( ) ;
2021-03-13 22:39:55 +01:00
2022-12-04 18:02:33 +00:00
WebIDL : : ExceptionOr < DeprecatedString > inner_html ( ) const ;
WebIDL : : ExceptionOr < void > set_inner_html ( DeprecatedString const & ) ;
2020-03-25 18:53:20 +01:00
2022-12-04 18:02:33 +00:00
WebIDL : : ExceptionOr < void > insert_adjacent_html ( DeprecatedString position , DeprecatedString text ) ;
2022-09-20 18:28:41 +02:00
2020-08-14 19:40:37 +02:00
bool is_focused ( ) const ;
2021-06-18 16:42:34 -06:00
bool is_active ( ) const ;
2023-01-08 19:23:00 -05:00
JS : : NonnullGCPtr < HTMLCollection > get_elements_by_class_name ( DeprecatedFlyString const & ) ;
2021-02-07 23:44:01 +01:00
2023-01-28 20:33:36 +01:00
bool is_shadow_host ( ) const ;
2023-01-28 20:22:52 +01:00
ShadowRoot * shadow_root_internal ( ) { return m_shadow_root . ptr ( ) ; }
ShadowRoot const * shadow_root_internal ( ) const { return m_shadow_root . ptr ( ) ; }
2022-08-28 13:42:07 +02:00
void set_shadow_root ( JS : : GCPtr < ShadowRoot > ) ;
2021-02-10 18:21:35 +01:00
2023-01-08 19:23:00 -05:00
void set_custom_properties ( HashMap < DeprecatedFlyString , CSS : : StyleProperty > custom_properties ) { m_custom_properties = move ( custom_properties ) ; }
HashMap < DeprecatedFlyString , CSS : : StyleProperty > const & custom_properties ( ) const { return m_custom_properties ; }
2021-05-28 21:21:44 +02:00
2022-09-24 12:14:53 +02:00
void queue_an_element_task ( HTML : : Task : : Source , JS : : SafeFunction < void ( ) > ) ;
2021-09-09 00:59:09 +02:00
2021-09-13 22:42:15 +01:00
bool is_void_element ( ) const ;
bool serializes_as_void ( ) const ;
2022-09-04 01:59:58 +02:00
JS : : NonnullGCPtr < Geometry : : DOMRect > get_bounding_client_rect ( ) const ;
JS : : NonnullGCPtr < Geometry : : DOMRectList > get_client_rects ( ) const ;
2021-09-27 00:55:13 +02:00
2022-10-17 14:41:50 +02:00
virtual JS : : GCPtr < Layout : : Node > create_layout_node ( NonnullRefPtr < CSS : : StyleProperties > ) ;
2022-02-05 13:17:01 +01:00
2022-02-06 19:27:10 +01:00
virtual void did_receive_focus ( ) { }
virtual void did_lose_focus ( ) { }
2022-10-17 14:41:50 +02:00
static JS : : GCPtr < Layout : : Node > create_layout_node_for_display_type ( DOM : : Document & , CSS : : Display const & , NonnullRefPtr < CSS : : StyleProperties > , Element * ) ;
2022-02-24 11:56:03 +00:00
2022-10-17 14:41:50 +02:00
void set_pseudo_element_node ( Badge < Layout : : TreeBuilder > , CSS : : Selector : : PseudoElement , JS : : GCPtr < Layout : : Node > ) ;
JS : : GCPtr < Layout : : Node > get_pseudo_element_node ( CSS : : Selector : : PseudoElement ) const ;
2022-03-03 17:50:12 +00:00
void clear_pseudo_element_nodes ( Badge < Layout : : TreeBuilder > ) ;
void serialize_pseudo_elements_as_json ( JsonArraySerializer < StringBuilder > & children_array ) const ;
2022-11-05 03:58:14 +00:00
i32 tab_index ( ) const ;
void set_tab_index ( i32 tab_index ) ;
2022-11-05 15:10:13 +00:00
bool is_potentially_scrollable ( ) const ;
double scroll_top ( ) const ;
double scroll_left ( ) const ;
void set_scroll_top ( double y ) ;
void set_scroll_left ( double x ) ;
int scroll_width ( ) const ;
int scroll_height ( ) const ;
2022-09-30 16:21:34 +01:00
bool is_actually_disabled ( ) const ;
2022-12-04 18:02:33 +00:00
WebIDL : : ExceptionOr < JS : : GCPtr < Element > > insert_adjacent_element ( DeprecatedString const & where , JS : : NonnullGCPtr < Element > element ) ;
WebIDL : : ExceptionOr < void > insert_adjacent_text ( DeprecatedString const & where , DeprecatedString const & data ) ;
2022-10-01 00:30:15 +01:00
2022-10-04 19:52:25 +02:00
// https://w3c.github.io/csswg-drafts/cssom-view-1/#dom-element-scrollintoview
2022-12-24 13:15:12 +01:00
ErrorOr < void > scroll_into_view ( Optional < Variant < bool , ScrollIntoViewOptions > > = { } ) ;
2022-10-04 19:52:25 +02:00
2022-11-28 17:58:13 -06:00
// https://www.w3.org/TR/wai-aria-1.2/#ARIAMixin
# define ARIA_IMPL(name, attribute) \
DeprecatedString name ( ) const override \
{ \
return get_attribute ( attribute ) ; \
} \
\
WebIDL : : ExceptionOr < void > set_ # # name ( DeprecatedString const & value ) override \
{ \
TRY ( set_attribute ( attribute , value ) ) ; \
return { } ; \
}
// https://www.w3.org/TR/wai-aria-1.2/#accessibilityroleandproperties-correspondence
ARIA_IMPL ( role , " role " ) ;
ARIA_IMPL ( aria_active_descendant , " aria-activedescendant " ) ;
ARIA_IMPL ( aria_atomic , " aria-atomic " ) ;
ARIA_IMPL ( aria_auto_complete , " aria-autocomplete " ) ;
ARIA_IMPL ( aria_busy , " aria-busy " ) ;
ARIA_IMPL ( aria_checked , " aria-checked " ) ;
ARIA_IMPL ( aria_col_count , " aria-colcount " ) ;
ARIA_IMPL ( aria_col_index , " aria-colindex " ) ;
ARIA_IMPL ( aria_col_span , " aria-colspan " ) ;
ARIA_IMPL ( aria_controls , " aria-controls " ) ;
ARIA_IMPL ( aria_current , " aria-current " ) ;
ARIA_IMPL ( aria_described_by , " aria-describedby " ) ;
ARIA_IMPL ( aria_details , " aria-details " ) ;
ARIA_IMPL ( aria_drop_effect , " aria-dropeffect " ) ;
ARIA_IMPL ( aria_error_message , " aria-errormessage " ) ;
ARIA_IMPL ( aria_disabled , " aria-disabled " ) ;
ARIA_IMPL ( aria_expanded , " aria-expanded " ) ;
ARIA_IMPL ( aria_flow_to , " aria-flowto " ) ;
ARIA_IMPL ( aria_grabbed , " aria-grabbed " ) ;
ARIA_IMPL ( aria_has_popup , " aria-haspopup " ) ;
ARIA_IMPL ( aria_hidden , " aria-hidden " ) ;
ARIA_IMPL ( aria_invalid , " aria-invalid " ) ;
ARIA_IMPL ( aria_key_shortcuts , " aria-keyshortcuts " ) ;
ARIA_IMPL ( aria_label , " aria-label " ) ;
ARIA_IMPL ( aria_labelled_by , " aria-labelledby " ) ;
ARIA_IMPL ( aria_level , " aria-level " ) ;
ARIA_IMPL ( aria_live , " aria-live " ) ;
ARIA_IMPL ( aria_modal , " aria-modal " ) ;
ARIA_IMPL ( aria_multi_line , " aria-multiline " ) ;
ARIA_IMPL ( aria_multi_selectable , " aria-multiselectable " ) ;
ARIA_IMPL ( aria_orientation , " aria-orientation " ) ;
ARIA_IMPL ( aria_owns , " aria-owns " ) ;
ARIA_IMPL ( aria_placeholder , " aria-placeholder " ) ;
ARIA_IMPL ( aria_pos_in_set , " aria-posinset " ) ;
ARIA_IMPL ( aria_pressed , " aria-pressed " ) ;
ARIA_IMPL ( aria_read_only , " aria-readonly " ) ;
ARIA_IMPL ( aria_relevant , " aria-relevant " ) ;
ARIA_IMPL ( aria_required , " aria-required " ) ;
ARIA_IMPL ( aria_role_description , " aria-roledescription " ) ;
ARIA_IMPL ( aria_row_count , " aria-rowcount " ) ;
ARIA_IMPL ( aria_row_index , " aria-rowindex " ) ;
ARIA_IMPL ( aria_row_span , " aria-rowspan " ) ;
ARIA_IMPL ( aria_selected , " aria-selected " ) ;
ARIA_IMPL ( aria_set_size , " aria-setsize " ) ;
ARIA_IMPL ( aria_sort , " aria-sort " ) ;
ARIA_IMPL ( aria_value_max , " aria-valuemax " ) ;
ARIA_IMPL ( aria_value_min , " aria-valuemin " ) ;
ARIA_IMPL ( aria_value_now , " aria-valuenow " ) ;
ARIA_IMPL ( aria_value_text , " aria-valuetext " ) ;
# undef ARIA_IMPL
2022-12-11 10:53:37 -06:00
virtual bool exclude_from_accessibility_tree ( ) const override ;
virtual bool include_in_accessibility_tree ( ) const override ;
2023-03-29 23:46:18 +01:00
void enqueue_a_custom_element_upgrade_reaction ( HTML : : CustomElementDefinition & custom_element_definition ) ;
void enqueue_a_custom_element_callback_reaction ( FlyString const & callback_name , JS : : MarkedVector < JS : : Value > arguments ) ;
Vector < Variant < CustomElementUpgradeReaction , CustomElementCallbackReaction > > & custom_element_reaction_queue ( ) { return m_custom_element_reaction_queue ; }
Vector < Variant < CustomElementUpgradeReaction , CustomElementCallbackReaction > > const & custom_element_reaction_queue ( ) const { return m_custom_element_reaction_queue ; }
JS : : ThrowCompletionOr < void > upgrade_element ( JS : : NonnullGCPtr < HTML : : CustomElementDefinition > custom_element_definition ) ;
void try_to_upgrade ( ) ;
bool is_defined ( ) const ;
bool is_custom ( ) const ;
Optional < String > const & is_value ( ) const { return m_is_value ; }
void set_is_value ( Optional < String > const & is ) { m_is_value = is ; }
void set_custom_element_state ( CustomElementState value ) { m_custom_element_state = value ; }
void setup_custom_element_from_constructor ( HTML : : CustomElementDefinition & custom_element_definition , Optional < String > const & is_value ) ;
2020-06-13 22:24:49 +02:00
protected :
2022-09-03 18:47:33 +02:00
Element ( Document & , DOM : : QualifiedName ) ;
2023-01-28 12:33:35 -05:00
virtual JS : : ThrowCompletionOr < void > initialize ( JS : : Realm & ) override ;
2022-09-03 18:47:33 +02:00
2021-10-12 17:53:52 +02:00
virtual void children_changed ( ) override ;
2022-11-05 03:58:14 +00:00
virtual i32 default_tab_index_value ( ) const ;
2019-10-05 22:27:52 +02:00
2022-08-28 13:42:07 +02:00
virtual void visit_edges ( Cell : : Visitor & ) override ;
2020-06-13 22:24:49 +02:00
private :
2021-05-04 22:25:43 +01:00
void make_html_uppercased_qualified_name ( ) ;
2023-01-08 19:23:00 -05:00
void invalidate_style_after_attribute_change ( DeprecatedFlyString const & attribute_name ) ;
2022-10-29 13:04:18 +02:00
2022-12-04 18:02:33 +00:00
WebIDL : : ExceptionOr < JS : : GCPtr < Node > > insert_adjacent ( DeprecatedString const & where , JS : : NonnullGCPtr < Node > node ) ;
2022-10-01 00:30:15 +01:00
2023-03-29 23:46:18 +01:00
void enqueue_an_element_on_the_appropriate_element_queue ( ) ;
2020-10-10 02:48:05 +01:00
QualifiedName m_qualified_name ;
2022-12-04 18:02:33 +00:00
DeprecatedString m_html_uppercased_qualified_name ;
2020-01-02 14:52:34 +01:00
2022-09-03 18:47:33 +02:00
JS : : GCPtr < NamedNodeMap > m_attributes ;
2022-08-28 13:42:07 +02:00
JS : : GCPtr < CSS : : ElementInlineCSSStyleDeclaration > m_inline_style ;
JS : : GCPtr < DOMTokenList > m_class_list ;
JS : : GCPtr < ShadowRoot > m_shadow_root ;
2020-12-07 19:56:53 +01:00
2022-03-15 19:41:35 +01:00
RefPtr < CSS : : StyleProperties > m_computed_css_values ;
2023-01-08 19:23:00 -05:00
HashMap < DeprecatedFlyString , CSS : : StyleProperty > m_custom_properties ;
2020-05-26 23:07:19 +02:00
2023-03-07 19:54:01 +01:00
Vector < FlyString > m_classes ;
2021-02-10 18:21:35 +01:00
2022-11-30 18:27:26 -05:00
Array < JS : : GCPtr < Layout : : Node > , to_underlying ( CSS : : Selector : : PseudoElement : : PseudoElementCount ) > m_pseudo_element_nodes ;
2023-03-29 23:46:18 +01:00
// https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reaction-queue
// All elements have an associated custom element reaction queue, initially empty. Each item in the custom element reaction queue is of one of two types:
// NOTE: See the structs at the top of this header.
Vector < Variant < CustomElementUpgradeReaction , CustomElementCallbackReaction > > m_custom_element_reaction_queue ;
// https://dom.spec.whatwg.org/#concept-element-custom-element-state
CustomElementState m_custom_element_state { CustomElementState : : Undefined } ;
// https://dom.spec.whatwg.org/#concept-element-custom-element-definition
JS : : GCPtr < HTML : : CustomElementDefinition > m_custom_element_definition ;
// https://dom.spec.whatwg.org/#concept-element-is-value
Optional < String > m_is_value ;
2019-06-15 18:55:47 +02:00
} ;
2019-10-06 20:37:39 +02:00
2021-01-07 17:31:26 +01:00
template < >
2021-01-17 09:34:01 +01:00
inline bool Node : : fast_is < Element > ( ) const { return is_element ( ) ; }
2021-01-07 17:31:26 +01:00
2023-01-08 19:23:00 -05:00
WebIDL : : ExceptionOr < QualifiedName > validate_and_extract ( JS : : Realm & , DeprecatedFlyString namespace_ , DeprecatedFlyString qualified_name ) ;
2022-03-02 10:55:16 +01:00
2021-01-07 17:31:26 +01:00
}