Skip to content

Commit 18c5b2e

Browse files
committed
Write about embedding API
1 parent 48a598a commit 18c5b2e

File tree

3 files changed

+46
-36
lines changed

3 files changed

+46
-36
lines changed

_posts/2025-12-12-november-in-servo.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ summary: ao!! wrrrrao!!
77
categories:
88
---
99

10-
Landing in [**Servo 0.0.3**](https://github.com/servo/servo/releases/tag/v0.0.3) and our November nightly builds:
10+
Landing in [**Servo 0.0.3**](https://github.com/servo/servo/releases/tag/v0.0.3) and our November nightly builds, we now have **context menus** for links, images, and other web content (@mrobinson, @atbrakhi, #40402, #40501, #40607), plus several web platform features:
1111

1212
- **<video controls>** (@rayguo17, #40578)
1313
- **<use>** in SVG (@WaterWhisperer, #40684)
@@ -37,6 +37,22 @@ We now have full support for **SHA3-256**, **SHA3-384**, **SHA3-512** (@kkoyung,
3737
**<details>** now fires **‘toggle’** events (@lukewarlow, #40271), and **<details name>** is now exclusive, like radio buttons (@simonwuelker, #40314).
3838
**InputEvent**, which represents **‘input’** and **‘beforeinput’** events, now has **composed**, **data**, **isComposing**, and **inputType** properties (@excitablesnowball, #39989).
3939

40+
## Embedding API
41+
42+
**Each webview** can now now have its **own rendering context** (@mrobinson, @mukilan, #40794, #40738, #40721, #40594, #40923).
43+
This effectively enables full support for **multiple windows**, and you’ll see servoshell make use of that this month.
44+
45+
[**WebView**](https://doc.servo.org/servo/struct.WebView.html) now has [**can_go_back()**](https://doc.servo.org/servo/struct.WebView.html#method.can_go_back) and [**can_go_forward()**](https://doc.servo.org/servo/struct.WebView.html#method.can_go_forward) methods, and servoshell now uses those to disable the back and forward buttons (@mrobinson, #40598).
46+
47+
Having introduced our new [**RefreshDriver**](https://doc.servo.org/servo/trait.RefreshDriver.html) API in October, we’ve now **removed [Servo](https://doc.servo.org/servo/struct.Servo.html)::<wbr>animating()** (@mrobinson, #40799) and **[ServoDelegate](https://doc.servo.org/servo/trait.ServoDelegate.html)::<wbr>notify_<wbr>animating_<wbr>changed()** (@mrobinson, #40886), and similarly cleaned up the obsolete and inefficient “animating” state in servoshell (@mrobinson, #40715).
48+
49+
We’ve moved virtually all of the useful items in the Servo API to the root of the `servo` library crate (@mrobinson, #40951).
50+
This is a **breaking change**, but we expect that it will greatly simplify embedding Servo, and it means you can even write `use servo::*;` in a pinch.
51+
52+
When running Servo without a custom [**ClipboardDelegate**](https://doc.servo.org/servo/clipboard_delegate/trait.ClipboardDelegate.html), we normally use the system clipboard by default.
53+
But if there’s no system clipboard, we now have a built-in **fallback clipboard** (@mrobinson, #40408), rather than having no clipboard at all.
54+
Note that the fallback clipboard is very limited, as it can only store text and does not work across processes.
55+
4056
<style>
4157
._correction {
4258
max-width: 33em;

commits.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ https://github.com/servo/servo/pull/40316 (@tharkum, #40316) html: Support relea
762762
# [//]: # (dependabot-automerge-start)
763763
# [//]: # (dependabot-automerge-end)
764764
+https://github.com/servo/servo/pull/40408 (@mrobinson, #40408) libservo: Add a fallback clipboard (#40408)
765-
api
765+
;api
766766
# Add a fallback implementation of the default clipboard delegate that
767767
# works within a single Servo process. This introduces one failure, which
768768
# was hidden before.
@@ -839,7 +839,7 @@ https://github.com/servo/servo/pull/40411 (@simonwuelker, #40411) xpath: Handle
839839
# cause unnecessary merge conflicts.
840840
# Testing: New web platform tests start to pass
841841
+https://github.com/servo/servo/pull/40402 (@mrobinson, @atbrakhi, #40402) libservo: Integrate context menu into the show_embedder_control API (#40402)
842-
api servoshell; rework context menu api, embedders can now know the position and know what each item does (`show_context_menu(webview, result_sender, title, items)` → `ContextMenu.{id,position,items,select,dismiss}()`)
842+
;api servoshell; rework context menu api, embedders can now know the position and know what each item does (`show_context_menu(webview, result_sender, title, items)` → `ContextMenu.{id,position,items,select,dismiss}()`)
843843
# This PR integrates showing context menus into the
844844
# `WebViewDelegate::show_embedder_control` API. In addition,
845845
# `ContextMenuItem` and `ContextMenuAction` data types are exposed which
@@ -1790,7 +1790,7 @@ https://github.com/servo/servo/pull/40542 (@simonwuelker, #40542) xpath: Don't e
17901790
# roughly 600 lines. There was also a blocking section which was split out.
17911791
# Testing: Should not change functionality and tests still work.
17921792
+https://github.com/servo/servo/pull/40501 (@mrobinson, @atbrakhi, #40501) script: Add context-based context menu options (#40501)
1793-
api servoshell; copy link, open link in new, copy image link, open image in new, cut, copy, paste, select all
1793+
;api servoshell; copy link, open link in new, copy image link, open image in new, cut, copy, paste, select all
17941794
# Add context menu options for images, links, and editable text areas. In
17951795
# addition add the ability to show menu options that are disabled. This
17961796
# also improves the visual style of the context menu in egui as part of
@@ -1844,7 +1844,7 @@ https://github.com/servo/servo/pull/40541 (@simonwuelker, #40541) tests: Import
18441844
# `played`. See https://html.spec.whatwg.org/multipage/#earliest-possible-position
18451845
# Testing: No expected changes in tests
18461846
+https://github.com/servo/servo/pull/40598 (@mrobinson, #40598) libservo: Add `WebView::can_go_forward` and `WebView::can_go_back` (#40598)
1847-
api servoshell
1847+
;api servoshell
18481848
# These two new API method make it easier to enable and disable the back
18491849
# and forward buttons in the browser UI. In addition, they are used to
18501850
# enable and disable the context menu items for "Back" and "Forward". This
@@ -3027,7 +3027,7 @@ https://github.com/servo/servo/pull/40737 (@mrobinson, @mukilan, #40737) composi
30273027
# for a single `Constellation`.
30283028
# Testing: This should not change behavior so is covered by existing tests.
30293029
+https://github.com/servo/servo/pull/40738 (@mrobinson, @mukilan, #40738) compositing: Make `RefreshDriver` per-`RenderingContext` (#40738)
3030-
api; part of per-webview RenderingContext
3030+
;api; part of per-webview RenderingContext
30313031
# Instead of having a global `RefreshDriver` for all of Servo, let each
30323032
# `RenderingContext` have its own `RefreshDriver`. This allows for things
30333033
# like per-monitor `RefreshDriver`s and helps to ensure that multiple
@@ -3148,7 +3148,7 @@ https://github.com/servo/servo/pull/40690 (@mrobinson, @mukilan, #40690) composi
31483148
# thread.
31493149
# Testing: This doesn't really change behavior yet, so is covered by existing tests.
31503150
+https://github.com/servo/servo/pull/40721 (@mrobinson, @mukilan, #40721) compositing: Allow WebGL contexts to have different Surfman devices (#40721)
3151-
api; part of per-webview RenderingContext
3151+
;api; part of per-webview RenderingContext
31523152
# Currently, a single `surfman::Device` is used for all WebGL contexts.
31533153
# This cannot work when we have multiple rendering contexts. So, extract
31543154
# the surfman `Connection` and `Adapter` into a per-painter data structure
@@ -3172,7 +3172,7 @@ https://github.com/servo/servo/pull/40690 (@mrobinson, @mukilan, #40690) composi
31723172
# dependency in `requirements.txt` was not removed. This PR fixest that.
31733173
# Testing: This change just removes an unsued build dependency, so no testing is necessary.
31743174
+https://github.com/servo/servo/pull/40715 (@mrobinson, #40715) servoshell: Always use `ControlFlow::Wait` on winit (#40715)
3175-
api; removed in favour of RefreshDriver
3175+
;api; removed in favour of RefreshDriver
31763176
# Nowadays the renderer will always wake up the event loop when it needs to paint
31773177
# a new frame, so we can always use `ControlFlow::Wait`. This should be a
31783178
# more efficient way to run animations.
@@ -3398,7 +3398,7 @@ https://github.com/servo/servo/pull/40637 (@kongbai1996, #40637) Compositor: Add
33983398
# into account what attributes changed, but at least it works.
33993399
# Testing: This doesn't have any test changes, but should fix the test situation described in #40419.
34003400
+https://github.com/servo/servo/pull/40607 (@mrobinson, #40607) libservo: Add `ContextMenuElementInformation` to for the context menu API (#40607)
3401-
api; element_info() on ContextMenu
3401+
;api; element_info() on ContextMenu
34023402
# This new data structure allows passing more information when popping up
34033403
# context menus. It's possible in the future that it will be adapted into
34043404
# a more generic "hit test result" type API ala WebKit, but for now, this is probably
@@ -3454,7 +3454,7 @@ https://github.com/servo/servo/pull/40685 (@tharkum, #40685) html: Fire the <med
34543454
# correct enum variants.
34553455
# Testing: Pass some WPT tests that were expected to fail.
34563456
+https://github.com/servo/servo/pull/40594 (@mukilan, @mrobinson, #40594) compositing: Allow WebGL contexts to have different Surfman devices (#40594)
3457-
api; part of per-webview RenderingContext
3457+
;api; part of per-webview RenderingContext
34583458
# Currently, a single `surfman::Device` is used for all WebGL contexts. This cannot work when we have multiple
34593459
# rendering contexts. So, extract the surfman `Connection` and `Adapter` into a per-painter data structure
34603460
# (`PainterSurfmanDetailsMap`) and store the `Device` directly in the WebGL context.
@@ -3533,7 +3533,7 @@ https://github.com/servo/servo/pull/40666 (@arihant2math, @yezhizhen, #40666) in
35333533
# if the relayout damage is in the element or a descendant.
35343534
# Testing: Not needed, no change in behavior
35353535
+https://github.com/servo/servo/pull/40794 (@mrobinson, #40794) libservo: Have `WebView` take a `RenderingContext` rather than `Servo` (#40794)
3536-
api; per-webview rendering contexts (big part of support for multiple windows)
3536+
;api; per-webview rendering contexts (big part of support for multiple windows)
35373537
# This is the last major change before we can try to implement support for
35383538
# multiple windows in Servo. This change makes it so that each `WebView`
35393539
# (via `WebViewBuilder`) takes the `RenderingContext` as an argument,
@@ -3561,7 +3561,7 @@ https://github.com/servo/servo/pull/40653 (@TimvdLippe, #40653) libservo: Notify
35613561
# ```
35623562
# Part of #40615
35633563
+https://github.com/servo/servo/pull/40799 (@mrobinson, #40799) libservo: Remove `Servo::animating()` (#40799)
3564-
api; removed in favour of RefreshDriver
3564+
;api; removed in favour of RefreshDriver
35653565
# Instead of relying on `Sevo::animating()` in servoshell to drive the
35663566
# event loop, it is sufficient to just let the `RefreshDriver` wake it up
35673567
# when it is time to re-render.
@@ -4227,7 +4227,7 @@ https://github.com/servo/servo/pull/40843 (@dyegoaurelio, #40843) script: Move C
42274227
# try](https://github.com/servo/servo/actions/runs/19614805970/job/56165963814)
42284228
>>> 2025-11-26T06:18:52Z
42294229
+https://github.com/servo/servo/pull/40886 (@mrobinson, #40886) libservo: Remove `ServoDelegate::notify_animating_changed` (#40886)
4230-
api; removed in favour of RefreshDriver
4230+
;api; removed in favour of RefreshDriver
42314231
# This is dead code #40799, as it is never called. Remove the delegate
42324232
# call and the entire `ServoShellServoDelegate` as the only thing that it
42334233
# was doing was printing top-level errors which only happen when something
@@ -4708,7 +4708,7 @@ https://github.com/servo/servo/pull/40661 (@janvarga, #40661) storage: Introduce
47084708
# next-generation IndexedDB implementation under the indexeddb_next feature flag living on a separate branch.
47094709
# Testing: Unit and WPT tests continue to pass
47104710
+https://github.com/servo/servo/pull/40923 (@mrobinson, #40923) libservo: Starting removing the multi-document interface API (#40923)
4711-
api; remove old multiple webview features in favour of per-webview RenderingContext
4711+
;api; remove old multiple webview features in favour of per-webview RenderingContext
47124712
# For a while Servo has while had a somewhat unfinished multi-document
47134713
# interface API that was meant to implement a kind of window manager
47144714
# inside a single `RenderingContext`. This came with some focus handling
@@ -4796,7 +4796,7 @@ https://github.com/servo/servo/pull/40944 (@mrobinson, #40944) constellation: Br
47964796
# Testing: This should not change behavior in a way that is observable, so should
47974797
# be covered by existing tests.
47984798
+https://github.com/servo/servo/pull/40951 (@mrobinson, #40951) libservo: Clean up Servo exports and export more at the root (#40951)
4799-
api; `use servo::*`
4799+
;api; `use servo::*`
48004800
# This change makes it easier for embedders to embed the types that they
48014801
# need by exporting almost everything necessary to use Servo at the root
48024802
# of libservo, apart from a few exceptions. In addition, the `Servo` is moved

0 commit comments

Comments
 (0)