| 
									
										
										
										
											2020-01-18 09:38:21 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2022-02-05 13:17:01 +01:00
										 |  |  |  * Copyright (c) 2018-2022, 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
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-15 22:49:44 +02:00
										 |  |  | #include <AK/Badge.h>
 | 
					
						
							| 
									
										
										
										
											2021-06-07 16:32:24 +01:00
										 |  |  | #include <AK/JsonObjectSerializer.h>
 | 
					
						
							| 
									
										
										
										
											2019-06-21 18:45:35 +02:00
										 |  |  | #include <AK/RefPtr.h>
 | 
					
						
							| 
									
										
										
										
											2019-09-28 22:59:16 +02:00
										 |  |  | #include <AK/String.h>
 | 
					
						
							| 
									
										
										
										
											2020-07-26 17:16:18 +02:00
										 |  |  | #include <AK/TypeCasts.h>
 | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | #include <AK/Vector.h>
 | 
					
						
							| 
									
										
										
										
											2020-03-14 13:15:11 +01:00
										 |  |  | #include <LibWeb/Bindings/Wrappable.h>
 | 
					
						
							| 
									
										
										
										
											2020-03-18 15:22:31 +01:00
										 |  |  | #include <LibWeb/DOM/EventTarget.h>
 | 
					
						
							| 
									
										
										
										
											2021-04-06 19:34:49 +01:00
										 |  |  | #include <LibWeb/DOM/ExceptionOr.h>
 | 
					
						
							| 
									
										
										
										
											2020-03-07 10:32:51 +01:00
										 |  |  | #include <LibWeb/TreeNode.h>
 | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-26 19:37:56 +02:00
										 |  |  | namespace Web::DOM { | 
					
						
							| 
									
										
										
										
											2020-03-07 10:27:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-06 17:06:25 +00:00
										 |  |  | enum class NodeType : u16 { | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  |     INVALID = 0, | 
					
						
							|  |  |  |     ELEMENT_NODE = 1, | 
					
						
							| 
									
										
										
										
											2021-03-06 17:06:25 +00:00
										 |  |  |     ATTRIBUTE_NODE = 2, | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  |     TEXT_NODE = 3, | 
					
						
							| 
									
										
										
										
											2021-03-06 17:06:25 +00:00
										 |  |  |     CDATA_SECTION_NODE = 4, | 
					
						
							|  |  |  |     ENTITY_REFERENCE_NODE = 5, | 
					
						
							|  |  |  |     ENTITY_NODE = 6, | 
					
						
							|  |  |  |     PROCESSING_INSTRUCTION_NODE = 7, | 
					
						
							| 
									
										
										
										
											2019-10-12 23:26:47 +02:00
										 |  |  |     COMMENT_NODE = 8, | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  |     DOCUMENT_NODE = 9, | 
					
						
							| 
									
										
										
										
											2019-10-09 20:17:01 +02:00
										 |  |  |     DOCUMENT_TYPE_NODE = 10, | 
					
						
							| 
									
										
										
										
											2019-11-06 20:27:53 +01:00
										 |  |  |     DOCUMENT_FRAGMENT_NODE = 11, | 
					
						
							| 
									
										
										
										
											2021-03-06 17:06:25 +00:00
										 |  |  |     NOTATION_NODE = 12 | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-16 03:04:55 +01:00
										 |  |  | struct GetRootNodeOptions { | 
					
						
							|  |  |  |     bool composed { false }; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-14 13:15:11 +01:00
										 |  |  | class Node | 
					
						
							|  |  |  |     : public TreeNode<Node> | 
					
						
							| 
									
										
										
										
											2020-03-18 15:22:31 +01:00
										 |  |  |     , public EventTarget | 
					
						
							| 
									
										
										
										
											2020-03-14 13:15:11 +01:00
										 |  |  |     , public Bindings::Wrappable { | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2020-03-14 13:24:15 +01:00
										 |  |  |     using WrapperType = Bindings::NodeWrapper; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-18 15:22:31 +01:00
										 |  |  |     using TreeNode<Node>::ref; | 
					
						
							|  |  |  |     using TreeNode<Node>::unref; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-10 18:22:20 +01:00
										 |  |  |     ParentNode* parent_or_shadow_host(); | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     ParentNode const* parent_or_shadow_host() const { return const_cast<Node*>(this)->parent_or_shadow_host(); } | 
					
						
							| 
									
										
										
										
											2021-02-10 18:22:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-18 15:22:31 +01:00
										 |  |  |     // ^EventTarget
 | 
					
						
							|  |  |  |     virtual void ref_event_target() final { ref(); } | 
					
						
							|  |  |  |     virtual void unref_event_target() final { unref(); } | 
					
						
							| 
									
										
										
										
											2021-01-18 12:15:02 +01:00
										 |  |  |     virtual JS::Object* create_wrapper(JS::GlobalObject&) override; | 
					
						
							| 
									
										
										
										
											2020-03-18 15:22:31 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  |     virtual ~Node(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-11 21:52:59 +02:00
										 |  |  |     void removed_last_ref(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  |     NodeType type() const { return m_type; } | 
					
						
							|  |  |  |     bool is_element() const { return type() == NodeType::ELEMENT_NODE; } | 
					
						
							|  |  |  |     bool is_text() const { return type() == NodeType::TEXT_NODE; } | 
					
						
							|  |  |  |     bool is_document() const { return type() == NodeType::DOCUMENT_NODE; } | 
					
						
							| 
									
										
										
										
											2019-10-09 20:17:01 +02:00
										 |  |  |     bool is_document_type() const { return type() == NodeType::DOCUMENT_TYPE_NODE; } | 
					
						
							| 
									
										
										
										
											2019-10-12 23:26:47 +02:00
										 |  |  |     bool is_comment() const { return type() == NodeType::COMMENT_NODE; } | 
					
						
							|  |  |  |     bool is_character_data() const { return type() == NodeType::TEXT_NODE || type() == NodeType::COMMENT_NODE; } | 
					
						
							| 
									
										
										
										
											2019-11-06 20:27:53 +01:00
										 |  |  |     bool is_document_fragment() const { return type() == NodeType::DOCUMENT_FRAGMENT_NODE; } | 
					
						
							| 
									
										
										
										
											2020-03-25 18:48:10 +01:00
										 |  |  |     bool is_parent_node() const { return is_element() || is_document() || is_document_fragment(); } | 
					
						
							| 
									
										
										
										
											2020-11-21 18:32:39 +00:00
										 |  |  |     bool is_slottable() const { return is_element() || is_text(); } | 
					
						
							| 
									
										
										
										
											2022-01-31 18:05:54 +00:00
										 |  |  |     bool is_attribute() const { return type() == NodeType::ATTRIBUTE_NODE; } | 
					
						
							| 
									
										
										
										
											2022-03-13 17:21:27 +01:00
										 |  |  |     virtual bool is_shadow_root() const { return false; } | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-05 10:26:09 +02:00
										 |  |  |     virtual bool requires_svg_container() const { return false; } | 
					
						
							|  |  |  |     virtual bool is_svg_container() const { return false; } | 
					
						
							| 
									
										
										
										
											2022-03-12 16:08:40 +01:00
										 |  |  |     virtual bool is_svg_svg_element() const { return false; } | 
					
						
							| 
									
										
										
										
											2021-08-05 10:26:09 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-29 22:23:28 +02:00
										 |  |  |     bool in_a_document_tree() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-06 17:06:25 +00:00
										 |  |  |     // NOTE: This is intended for the JS bindings.
 | 
					
						
							|  |  |  |     u16 node_type() const { return (u16)m_type; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-02 16:05:59 +02:00
										 |  |  |     virtual bool is_editable() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-27 17:58:57 +02:00
										 |  |  |     virtual bool is_html_html_element() const { return false; } | 
					
						
							| 
									
										
										
										
											2022-03-02 15:14:38 +01:00
										 |  |  |     virtual bool is_html_anchor_element() const { return false; } | 
					
						
							| 
									
										
										
										
											2021-09-16 00:52:10 +02:00
										 |  |  |     virtual bool is_html_template_element() const { return false; } | 
					
						
							| 
									
										
										
										
											2021-11-24 19:15:04 +03:00
										 |  |  |     virtual bool is_browsing_context_container() const { return false; } | 
					
						
							| 
									
										
										
										
											2021-09-16 00:52:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-13 23:03:48 +04:30
										 |  |  |     ExceptionOr<NonnullRefPtr<Node>> pre_insert(NonnullRefPtr<Node>, RefPtr<Node>); | 
					
						
							|  |  |  |     ExceptionOr<NonnullRefPtr<Node>> pre_remove(NonnullRefPtr<Node>); | 
					
						
							| 
									
										
										
										
											2021-04-06 19:34:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-13 23:03:48 +04:30
										 |  |  |     ExceptionOr<NonnullRefPtr<Node>> append_child(NonnullRefPtr<Node>); | 
					
						
							| 
									
										
										
										
											2022-02-21 22:21:59 +01:00
										 |  |  |     ExceptionOr<NonnullRefPtr<Node>> remove_child(NonnullRefPtr<Node>); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-06 19:34:49 +01:00
										 |  |  |     void insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool suppress_observers = false); | 
					
						
							|  |  |  |     void remove(bool suppress_observers = false); | 
					
						
							|  |  |  |     void remove_all_children(bool suppress_observers = false); | 
					
						
							| 
									
										
										
										
											2021-04-10 17:21:22 -07:00
										 |  |  |     u16 compare_document_position(RefPtr<Node> other); | 
					
						
							| 
									
										
										
										
											2020-06-21 01:00:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-07 00:52:23 +01:00
										 |  |  |     ExceptionOr<NonnullRefPtr<Node>> replace_child(NonnullRefPtr<Node> node, NonnullRefPtr<Node> child); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-05 05:30:24 +01:00
										 |  |  |     NonnullRefPtr<Node> clone_node(Document* document = nullptr, bool clone_children = false); | 
					
						
							|  |  |  |     ExceptionOr<NonnullRefPtr<Node>> clone_node_binding(bool deep); | 
					
						
							| 
									
										
										
										
											2021-04-14 01:25:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-06 17:06:25 +00:00
										 |  |  |     // NOTE: This is intended for the JS bindings.
 | 
					
						
							|  |  |  |     bool has_child_nodes() const { return has_children(); } | 
					
						
							| 
									
										
										
										
											2021-10-02 20:37:45 +01:00
										 |  |  |     NonnullRefPtr<NodeList> child_nodes(); | 
					
						
							|  |  |  |     NonnullRefPtrVector<Node> children_as_vector() const; | 
					
						
							| 
									
										
										
										
											2021-03-06 17:06:25 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-16 19:09:14 +02:00
										 |  |  |     virtual FlyString node_name() const = 0; | 
					
						
							| 
									
										
										
										
											2019-09-28 22:59:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-06 00:21:59 +01:00
										 |  |  |     String descendant_text_content() const; | 
					
						
							|  |  |  |     String text_content() const; | 
					
						
							|  |  |  |     void set_text_content(String const&); | 
					
						
							| 
									
										
										
										
											2019-09-29 16:22:15 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-18 22:11:43 +00:00
										 |  |  |     String node_value() const; | 
					
						
							|  |  |  |     void set_node_value(String const&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-25 23:42:08 +02:00
										 |  |  |     Document& document() { return *m_document; } | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     Document const& document() const { return *m_document; } | 
					
						
							| 
									
										
										
										
											2019-09-29 11:43:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-02 21:03:50 +01:00
										 |  |  |     RefPtr<Document> owner_document() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-28 18:20:36 +02:00
										 |  |  |     const HTML::HTMLAnchorElement* enclosing_link_element() const; | 
					
						
							|  |  |  |     const HTML::HTMLElement* enclosing_html_element() const; | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     const HTML::HTMLElement* enclosing_html_element_with_attribute(FlyString const&) const; | 
					
						
							| 
									
										
										
										
											2019-09-29 12:24:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-24 21:59:24 +02:00
										 |  |  |     String child_text_content() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 19:27:42 +01:00
										 |  |  |     Node& root(); | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     Node const& root() const | 
					
						
							| 
									
										
										
										
											2020-11-21 18:32:39 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         return const_cast<Node*>(this)->root(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 19:27:42 +01:00
										 |  |  |     Node& shadow_including_root(); | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     Node const& shadow_including_root() const | 
					
						
							| 
									
										
										
										
											2020-11-21 18:32:39 +00:00
										 |  |  |     { | 
					
						
							|  |  |  |         return const_cast<Node*>(this)->shadow_including_root(); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-24 21:59:24 +02:00
										 |  |  |     bool is_connected() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-20 22:26:54 +02:00
										 |  |  |     Node* parent_node() { return parent(); } | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     Node const* parent_node() const { return parent(); } | 
					
						
							| 
									
										
										
										
											2020-06-20 22:26:54 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Element* parent_element(); | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     Element const* parent_element() const; | 
					
						
							| 
									
										
										
										
											2020-06-20 22:26:54 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-06 17:58:20 +01:00
										 |  |  |     virtual void inserted(); | 
					
						
							|  |  |  |     virtual void removed_from(Node*) { } | 
					
						
							| 
									
										
										
										
											2020-07-26 17:16:18 +02:00
										 |  |  |     virtual void children_changed() { } | 
					
						
							| 
									
										
										
										
											2021-07-05 05:33:35 +01:00
										 |  |  |     virtual void adopted_from(Document&) { } | 
					
						
							| 
									
										
										
										
											2021-07-05 05:30:24 +01:00
										 |  |  |     virtual void cloned(Node&, bool) {}; | 
					
						
							| 
									
										
										
										
											2019-09-29 17:40:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     Layout::Node const* layout_node() const { return m_layout_node; } | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  |     Layout::Node* layout_node() { return m_layout_node; } | 
					
						
							| 
									
										
										
										
											2019-10-04 21:05:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-10 15:50:57 +01:00
										 |  |  |     Painting::PaintableBox const* paint_box() const; | 
					
						
							| 
									
										
										
										
											2022-03-10 22:46:35 +01:00
										 |  |  |     Painting::Paintable const* paintable() const; | 
					
						
							| 
									
										
										
										
											2022-03-09 23:53:41 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  |     void set_layout_node(Badge<Layout::Node>, Layout::Node*) const; | 
					
						
							| 
									
										
										
										
											2019-10-04 21:05:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     virtual bool is_child_allowed(Node const&) const { return true; } | 
					
						
							| 
									
										
										
										
											2019-10-12 23:26:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-19 18:57:02 +02:00
										 |  |  |     bool needs_style_update() const { return m_needs_style_update; } | 
					
						
							| 
									
										
										
										
											2020-12-13 15:19:42 +01:00
										 |  |  |     void set_needs_style_update(bool); | 
					
						
							| 
									
										
										
										
											2019-10-19 18:57:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-14 12:04:30 +01:00
										 |  |  |     bool child_needs_style_update() const { return m_child_needs_style_update; } | 
					
						
							|  |  |  |     void set_child_needs_style_update(bool b) { m_child_needs_style_update = b; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-14 18:32:02 +02:00
										 |  |  |     void invalidate_style(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-19 21:21:29 +02:00
										 |  |  |     bool is_link() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-25 23:42:08 +02:00
										 |  |  |     void set_document(Badge<Document>, Document&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     virtual EventTarget* get_parent(Event const&) override; | 
					
						
							| 
									
										
										
										
											2020-11-21 18:32:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-17 09:34:01 +01:00
										 |  |  |     template<typename T> | 
					
						
							|  |  |  |     bool fast_is() const = delete; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-06 19:34:49 +01:00
										 |  |  |     ExceptionOr<void> ensure_pre_insertion_validity(NonnullRefPtr<Node> node, RefPtr<Node> child) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     bool is_host_including_inclusive_ancestor_of(Node const&) const; | 
					
						
							| 
									
										
										
										
											2021-04-06 19:34:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-30 22:28:28 +01:00
										 |  |  |     bool is_scripting_enabled() const; | 
					
						
							| 
									
										
										
										
											2021-07-05 03:59:47 +01:00
										 |  |  |     bool is_scripting_disabled() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-05 05:55:02 +01:00
										 |  |  |     bool contains(RefPtr<Node>) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-06-07 16:32:24 +01:00
										 |  |  |     // Used for dumping the DOM Tree
 | 
					
						
							|  |  |  |     void serialize_tree_as_json(JsonObjectSerializer<StringBuilder>&) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-02 02:17:13 +01:00
										 |  |  |     bool is_shadow_including_descendant_of(Node const&) const; | 
					
						
							|  |  |  |     bool is_shadow_including_inclusive_descendant_of(Node const&) const; | 
					
						
							|  |  |  |     bool is_shadow_including_ancestor_of(Node const&) const; | 
					
						
							|  |  |  |     bool is_shadow_including_inclusive_ancestor_of(Node const&) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 15:52:08 +01:00
										 |  |  |     i32 id() const { return m_id; } | 
					
						
							|  |  |  |     static Node* from_id(i32 node_id); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-13 22:42:15 +01:00
										 |  |  |     String serialize_fragment() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-06 01:25:58 +01:00
										 |  |  |     void replace_all(RefPtr<Node>); | 
					
						
							|  |  |  |     void string_replace_all(String const&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-13 12:49:23 +02:00
										 |  |  |     bool is_same_node(Node const*) const; | 
					
						
							| 
									
										
										
										
											2021-09-13 12:54:24 +02:00
										 |  |  |     bool is_equal_node(Node const*) const; | 
					
						
							| 
									
										
										
										
											2021-09-13 12:49:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-16 03:04:55 +01:00
										 |  |  |     NonnullRefPtr<Node> get_root_node(GetRootNodeOptions const& options = {}); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 19:20:57 +01:00
										 |  |  |     bool is_uninteresting_whitespace_node() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-26 08:18:14 +01:00
										 |  |  |     String debug_description() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-31 18:05:54 +00:00
										 |  |  |     size_t length() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | protected: | 
					
						
							| 
									
										
										
										
											2019-09-29 11:43:07 +02:00
										 |  |  |     Node(Document&, NodeType); | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-25 23:42:08 +02:00
										 |  |  |     Document* m_document { nullptr }; | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  |     mutable WeakPtr<Layout::Node> m_layout_node; | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  |     NodeType m_type { NodeType::INVALID }; | 
					
						
							| 
									
										
										
										
											2020-12-14 12:04:30 +01:00
										 |  |  |     bool m_needs_style_update { false }; | 
					
						
							|  |  |  |     bool m_child_needs_style_update { false }; | 
					
						
							| 
									
										
										
										
											2021-08-30 15:52:08 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     i32 m_id; | 
					
						
							| 
									
										
										
										
											2019-06-15 18:55:47 +02:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2019-10-06 20:37:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-07 10:27:02 +01:00
										 |  |  | } |