summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.cpp10
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.h11
2 files changed, 11 insertions, 10 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp
index 743336e3ba..4d7d29543f 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Node.cpp
@@ -927,16 +927,6 @@ void Node::remove_all_children(bool suppress_observers)
// https://dom.spec.whatwg.org/#dom-node-comparedocumentposition
u16 Node::compare_document_position(JS::GCPtr<Node> other)
{
- enum Position : u16 {
- DOCUMENT_POSITION_EQUAL = 0,
- DOCUMENT_POSITION_DISCONNECTED = 1,
- DOCUMENT_POSITION_PRECEDING = 2,
- DOCUMENT_POSITION_FOLLOWING = 4,
- DOCUMENT_POSITION_CONTAINS = 8,
- DOCUMENT_POSITION_CONTAINED_BY = 16,
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32,
- };
-
// 1. If this is other, then return zero.
if (this == other.ptr())
return DOCUMENT_POSITION_EQUAL;
diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h
index 85d81e5a20..82dd81b346 100644
--- a/Userland/Libraries/LibWeb/DOM/Node.h
+++ b/Userland/Libraries/LibWeb/DOM/Node.h
@@ -101,6 +101,17 @@ public:
void insert_before(JS::NonnullGCPtr<Node> node, JS::GCPtr<Node> child, bool suppress_observers = false);
void remove(bool suppress_observers = false);
void remove_all_children(bool suppress_observers = false);
+
+ enum DocumentPosition : u16 {
+ DOCUMENT_POSITION_EQUAL = 0,
+ DOCUMENT_POSITION_DISCONNECTED = 1,
+ DOCUMENT_POSITION_PRECEDING = 2,
+ DOCUMENT_POSITION_FOLLOWING = 4,
+ DOCUMENT_POSITION_CONTAINS = 8,
+ DOCUMENT_POSITION_CONTAINED_BY = 16,
+ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32,
+ };
+
u16 compare_document_position(JS::GCPtr<Node> other);
WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> replace_child(JS::NonnullGCPtr<Node> node, JS::NonnullGCPtr<Node> child);