Skip to content

Commit f529a4d

Browse files
committed
LibWeb: Add a FIXME comment about multiple DOM nodes in arrow navigation
1 parent 80412d1 commit f529a4d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Libraries/LibWeb/Selection/Selection.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,10 @@ GC::Ptr<DOM::Position> Selection::cursor_position() const
565565
return DOM::Position::create(m_document->realm(), *m_range->start_container(), m_range->start_offset());
566566
}
567567

568+
// FIXME: The offset adjustment algorithms below do not handle moving over multiple DOM nodes. For example, if we have:
569+
// `<div contenteditable><p>Well hello</p><p>friends</p></div>`, we should be able to move the cursor between the
570+
// two <p> elements. But the algorithms below limit us to a single DOM node.
571+
568572
void Selection::move_offset_to_next_character(bool collapse_selection)
569573
{
570574
auto* text_node = as_if<DOM::Text>(anchor_node().ptr());

0 commit comments

Comments
 (0)