Elaborate documentation of notify_history_changed in WebViewDelegate (#39134)

Elaborate documentation of on_history_changed in WebViewDelegate

Testing: Just documentation.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Narfinger 2025-09-08 02:42:45 +02:00 committed by GitHub
parent 9f4f598f44
commit ec8b5fc70b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 doesnt care?
fn notify_history_changed(&self, _webview: WebView, _: Vec<Url>, _: usize) {}
/// The navigation history of this [`WebView`] has changed. The navigation history is represented
/// as a `Vec<Url>` 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<Url>, _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