From ec8b5fc70bbb2cb3bdd930e281b16f9a27a52e3f Mon Sep 17 00:00:00 2001 From: Narfinger Date: Mon, 8 Sep 2025 02:42:45 +0200 Subject: [PATCH] Elaborate documentation of notify_history_changed in WebViewDelegate (#39134) Elaborate documentation of on_history_changed in WebViewDelegate Testing: Just documentation. --------- Signed-off-by: Narfinger Co-authored-by: Martin Robinson Co-authored-by: Euclid Ye --- components/servo/webview_delegate.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/servo/webview_delegate.rs b/components/servo/webview_delegate.rs index 21aed6fb931..85e0b6d3a5c 100644 --- a/components/servo/webview_delegate.rs +++ b/components/servo/webview_delegate.rs @@ -436,12 +436,12 @@ pub trait WebViewDelegate { /// The favicon of the currently loaded page in this [`WebView`] has changed. The new /// favicon [`Image`] can accessed via [`WebView::favicon`]. fn notify_favicon_changed(&self, _webview: WebView) {} - /// Notify the embedder that it needs to present a new frame. fn notify_new_frame_ready(&self, _webview: WebView) {} - /// The history state has changed. - // changed pattern; maybe wasteful if embedder doesn’t care? - fn notify_history_changed(&self, _webview: WebView, _: Vec, _: usize) {} + /// The navigation history of this [`WebView`] has changed. The navigation history is represented + /// as a `Vec` and `_current` denotes the current index in the history. New navigations, + /// back navigation, and forward navigation modify this index. + fn notify_history_changed(&self, _webview: WebView, _entries: Vec, _current: usize) {} /// A history traversal operation is complete. fn notify_traversal_complete(&self, _webview: WebView, _: TraversalId) {} /// Page content has closed this [`WebView`] via `window.close()`. It's the embedder's