Skip to content

Commit 69a7e9c

Browse files
committed
Write about even more API changes
1 parent 6207596 commit 69a7e9c

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

_posts/2025-11-02-this-month-in-servo.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ Servo now supports `new KeyboardEvent({keyCode})` and `({charCode})` (@atbrakhi,
2929
Our HTML-compatible **XPath** implementation now lives in its [own](https://github.com/servo/servo/tree/cd4c032908211fa2c26df550f6766080d1d28969/components/xpath) [crate](https://doc.servo.org/xpath/), and it’s no longer limited to the Servo DOM (@simonwuelker, #39546).
3030
We don’t have any specific plans to release this as a standalone library just yet, but please let us know if you have a use case that would benefit from this!
3131

32+
You can now **take screenshots** of webviews with <code>[WebView](https://doc.servo.org/servo/struct.WebView.html)::[take_screenshot](https://doc.servo.org/servo/struct.WebView.html#method.take_screenshot)</code> (@mrobinson, @delan, #39583).
33+
34+
Historically Servo has struggled with situations causing **100% CPU usage** or **unnecessary work on every tick** of the event loop, whenever a page is considered “active” or “animating” ([#25305](https://github.com/servo/servo/issues/25305), [#3406](https://github.com/servo/servo/issues/3406)).
35+
We had since throttled animations (@mrobinson, #37169) and reflows (@mrobinson, @Loirooriol, #38431), but only to fixed rates of 120 Hz and 60 Hz respectively.
36+
37+
But starting this month, you can run Servo with **vsync**, thanks to the **<code>[RefreshDriver](https://doc.servo.org/servo/trait.RefreshDriver.html)</code> trait** (@coding-joedow, @mrobinson, #39072), which allows embedders to tell Servo *when* to start rendering each frame.
38+
The [default driver](https://doc.servo.org/compositing/refresh_driver/struct.TimerRefreshDriver.html) continues to run at 120 Hz, but you can define and install your own with <code>[ServoBuilder](https://doc.servo.org/servo/struct.ServoBuilder.html)::[refresh_driver](https://doc.servo.org/servo/struct.ServoBuilder.html#method.refresh_driver)</code>.
39+
40+
### Breaking changes
41+
42+
Servo’s embedding API has had a few **breaking changes**:
43+
44+
- <code>[Opts](https://doc.servo.org/servo_config/opts/struct.Opts.html)::wait_for_stable_image</code> was **removed**; to wait for a stable image, call <code>[WebView](https://doc.servo.org/servo/struct.WebView.html)::[**take_screenshot**](https://doc.servo.org/servo/struct.WebView.html#method.take_screenshot)</code> instead (@mrobinson, @delan, #39583).
45+
- <code>[MouseButtonAction](https://doc.servo.org/servo/enum.MouseButtonAction.html)::Click</code> was **removed**; use <code>[**Down**](https://doc.servo.org/servo/enum.MouseButtonAction.html#variant.Down)</code> followed by <code>[**Up**](https://doc.servo.org/servo/enum.MouseButtonAction.html#variant.Up)</code>. [Click events](https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event) need to be *derived* from mouse button downs and ups to ensure that they are fired correctly (@mrobinson, #39705).
46+
3247
We’ve improved **page zoom** in our webview API (@atbrakhi, @mrobinson, @shubhamg13, #39738), which includes some **breaking changes**:
3348

3449
- <code>[WebView](https://doc.servo.org/servo/struct.WebView.html)::set_zoom</code> was renamed to <code>[set_page_zoom](https://doc.servo.org/servo/struct.WebView.html#method.set_page_zoom)</code>, and it now takes an **absolute** zoom value. This makes it idempotent, but it means if you want relative zoom, you’ll have to multiply the zoom values yourself.

outline.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@
7979
- https://github.com/servo/servo/pull/40260 (@jdm, #40260) script: Do not store an initial content size in new ResizeObservers. (#40260)
8080
dom
8181
- embedding
82-
- https://github.com/servo/servo/pull/39583 (@mrobinson, @delan, #39583) libservo: Add a `WebView::take_screenshot()` API and use it for reftests (#39583)
82+
- DONE https://github.com/servo/servo/pull/39583 (@mrobinson, @delan, #39583) libservo: Add a `WebView::take_screenshot()` API and use it for reftests (#39583)
8383
embedding
84-
- https://github.com/servo/servo/pull/39705 (@mrobinson, #39705) libservo: Remove `MouseButtonAction::Click` from the API (#39705)
84+
- DONE https://github.com/servo/servo/pull/39705 (@mrobinson, #39705) libservo: Remove `MouseButtonAction::Click` from the API (#39705)
8585
embedding
86-
- https://github.com/servo/servo/pull/39072 (@coding-joedow, @mrobinson, #39072) libservo: Allow embedders to drive frame updates via `RefreshDriver` trait (#39072)
86+
- DONE https://github.com/servo/servo/pull/39072 (@coding-joedow, @mrobinson, #39072) libservo: Allow embedders to drive frame updates via `RefreshDriver` trait (#39072)
8787
embedding
8888
- https://github.com/servo/servo/pull/40014 (@mrobinson, #40014) libservo: Merge input method activation into the EmbedderControl API (#40014)
8989
embedding

tools/commits.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
# Testing: There's only limited testing for this change due to https://github.com/servo/servo/issues/39551. But I think
120120
# that's okay, since the change is fairly trivial. Part of https://github.com/servo/servo/issues/34527
121121
+https://github.com/servo/servo/pull/39583 (@mrobinson, @delan, #39583) libservo: Add a `WebView::take_screenshot()` API and use it for reftests (#39583)
122-
embedding
122+
;embedding
123123
# This change adds a new API to the `WebView` for capturing screenshots. This makes it possible to:
124124
# - use the reftest waiting infrastructure via the API
125125
# easily.
@@ -876,7 +876,7 @@
876876
# Follow more closely spec, adding some missing steps.
877877
# Testing: should be covered by existing wpt tests
878878
+https://github.com/servo/servo/pull/39705 (@mrobinson, #39705) libservo: Remove `MouseButtonAction::Click` from the API (#39705)
879-
embedding
879+
;embedding
880880
# The embedder should never be responsible for triggering click events, so this change removes that possibility from the
881881
# API. In addition, triggering of click events is simplified by moving the logic to the `DocumentEventHandler`. This has
882882
# the benefit of making behavior consistent between in-process and out-of-process ``s. Now click events are never
@@ -2510,7 +2510,7 @@ https://github.com/servo/servo/pull/39794 (@TimvdLippe, #39794) Implement docume
25102510
# rebase manually by commenting `@dependabot rebase`.
25112511
# [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end)
25122512
+https://github.com/servo/servo/pull/39072 (@coding-joedow, @mrobinson, #39072) libservo: Allow embedders to drive frame updates via `RefreshDriver` trait (#39072)
2513-
embedding
2513+
;embedding
25142514
# Currently, the `RefreshDriver` creates a timer thread by default to limit the frame rate of animations to within 120fps.
25152515
# However, some platforms have already integrated `VSYNC` and even support `LTPO`, making the refresh rate of the current
25162516
# `RefreshDriver` mismatched with the display refresh rate of the platform. The main idea of this PR is to introduce the

0 commit comments

Comments
 (0)