From 93927d8243ae61b96fc70e6e7d44f8e0255b0408 Mon Sep 17 00:00:00 2001 From: Gingeh <39150378+Gingeh@users.noreply.github.com> Date: Sun, 13 Oct 2024 14:39:02 +1100 Subject: [PATCH] LibWeb: Set direction to forwards in addRange --- Userland/Libraries/LibWeb/Selection/Selection.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/Selection/Selection.cpp b/Userland/Libraries/LibWeb/Selection/Selection.cpp index 84179e83029..06c88d88b14 100644 --- a/Userland/Libraries/LibWeb/Selection/Selection.cpp +++ b/Userland/Libraries/LibWeb/Selection/Selection.cpp @@ -152,6 +152,9 @@ void Selection::add_range(JS::NonnullGCPtr range) // 3. Set this's range to range by a strong reference (not by making a copy). set_range(range); + + // AD-HOC: WPT selection/removeAllRanges.html and selection/addRange.htm expect this + m_direction = Direction::Forwards; } // https://w3c.github.io/selection-api/#dom-selection-removerange