Files
ladybird/Tests/LibWeb/Text/expected/HTML/Navigation-object-properties.txt
Praise-Garfield 49d24f1867 LibWeb: Fix off-by-one in Navigation::can_go_forward()
The getter compares the current entry index against the entry
list's size, but valid indices are in the range [0, size - 1].
An index equal to size is a past-the-end state that never occurs
in practice, so the function always returns true for any valid
index. This means it reports forward navigation is possible even
when the current entry is the last one in the list, where
forward() immediately throws an InvalidStateError.

The symmetric can_go_back() correctly checks against index 0,
and forward() correctly checks against size - 1. This brings
can_go_forward() in line with both.
2026-02-13 09:38:36 -05:00

6 lines
154 B
Plaintext

entries[length - 1] is current entry: true
currentEntry is a [object NavigationHistoryEntry]
transition is null: true
canGoBack: true
canGoForward: false