mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +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:
parent
0c839f0421
commit
461184d964
Notes:
sideshowbarker
2024-07-16 22:14:49 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 461184d964
Pull-request: https://github.com/SerenityOS/serenity/pull/23952
Reviewed-by: https://github.com/trflynn89
9 changed files with 30 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue