mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibWeb+LibWebView+WebContent: Add did_update_navigation_buttons_state()
It is going to be used to communicate whether it is possible to navigate back or forward after session history stored on browser side will no longer be used to driver navigation.
This commit is contained in:
committed by
Alexander Kalenik
parent
0c839f0421
commit
461184d964
@@ -782,6 +782,12 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_
|
||||
// 20. Set traversable's current session history step to targetStep.
|
||||
m_current_session_history_step = target_step;
|
||||
|
||||
// Not in the spec:
|
||||
auto back_enabled = m_current_session_history_step > 0;
|
||||
VERIFY(m_session_history_entries.size() > 0);
|
||||
auto forward_enabled = m_current_session_history_step < static_cast<int>(m_session_history_entries.size()) - 1;
|
||||
page().client().page_did_update_navigation_buttons_state(back_enabled, forward_enabled);
|
||||
|
||||
// 21. Return "applied".
|
||||
return HistoryStepResult::Applied;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user