aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo/webview_delegate.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-04-09 21:41:53 +0200
committerGitHub <noreply@github.com>2025-04-09 19:41:53 +0000
commit2fe57cc2a2e5e7b982f7a32349117e2516724682 (patch)
treed8f75104771bcc8e83ae3adcc81f55f0e00ffc82 /components/servo/webview_delegate.rs
parent935db71183c9744455cf8e85262c3bed9b212984 (diff)
downloadservo-2fe57cc2a2e5e7b982f7a32349117e2516724682.tar.gz
servo-2fe57cc2a2e5e7b982f7a32349117e2516724682.zip
libservo: Move animation tracking from `WindowMethods` to delegates (#36400)
This changes removes animation tracking from the `WindowMethods` trait and moves it to `ServoDelegate` and `WebViewDelegate`. - Animation changes per-`WebView` are now triggered in the compositor only when the value is updated there, rather than right after ticking animations. - Both `WebView` and `Servo` now expose an `animation()` method, so tracking animation state actually becomes unecessary in many cases, such as that of desktop servoshell, which can just read the value when the event loop spins. Testing: No tests necessary as the API layer is still untested. Later, tests will be added for the `WebView` API and this can be tested then. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/servo/webview_delegate.rs')
-rw-r--r--components/servo/webview_delegate.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/servo/webview_delegate.rs b/components/servo/webview_delegate.rs
index b631eae7404..ac3dc7a5152 100644
--- a/components/servo/webview_delegate.rs
+++ b/components/servo/webview_delegate.rs
@@ -375,6 +375,11 @@ pub trait WebViewDelegate {
/// This [`WebView`] has either become focused or lost focus. Whether or not the
/// [`WebView`] is focused can be accessed via [`WebView::focused`].
fn notify_focus_changed(&self, _webview: WebView, _focused: bool) {}
+ /// This [`WebView`] has either started to animate or stopped animating. When a
+ /// [`WebView`] is animating, it is up to the embedding application ensure that
+ /// `Servo::spin_event_loop` is called at regular intervals in order to update the
+ /// painted contents of the [`WebView`].
+ fn notify_animating_changed(&self, _webview: WebView, _animating: bool) {}
/// The `LoadStatus` of the currently loading or loaded page in this [`WebView`] has changed. The new
/// status can accessed via [`WebView::load_status`].
fn notify_load_status_changed(&self, _webview: WebView, _status: LoadStatus) {}