Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libservo: Add an initial WebView data structure to the API #35119

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

delan
Copy link
Member

@delan delan commented Jan 22, 2025

This patch introduces a new handle-based webview API to libservo, with
two main design goals:

  1. The lifetime of the handles controls the lifetime of the webview,
    giving the embedder full control over exactly when webviews are
    created and destroyed. This is consistent with how WebKitGTK’s
    WebView1 works; the engine can only create webviews via a create
    request2, and can only destroy them via a close request.
  2. All methods are infallible; if the constellation dies, the embedder
    finds out when calling Servo::handle_events.

For the moment, the embedder is only responsible for creating the
WebView id, and not the internal TopLevelBrowsingContext data
structures. This is so that the ScriptThread is able to get a handle on
the new WebView's WindowProxy in the case that it's an auxiliary
browsing context. In the future, the embedder should also be responsible
for creating the TopLevelBrowsingContext and the ScriptThread should
have mechanism to associate the two views so that WebView creation is
always executed through the same code path in the embedding layer. For
now, it's enough that the embedder can get a handle to the new WebView
when it's creation is requested.

Once we replace EmbedderMsg with a webview delegate trait, we will pass
WebView handles to the embedder, rather than webview ids. We’ll also add
detailed docs, once the design settles.

Signed-off-by: Delan Azabani [email protected]
Co-authored-by: Martin Robinson [email protected]


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___

Footnotes

  1. https://webkitgtk.org/reference/webkitgtk/stable/class.WebView.html

  2. (https://webkitgtk.org/reference/webkitgtk/stable/vfunc.WebView.create.html

@delan delan added the T-full Do a full try run label Jan 22, 2025
@github-actions github-actions bot removed the T-full Do a full try run label Jan 22, 2025
Copy link

🔨 Triggering try run (#12904764334) for Linux (Unit Tests, Build libservo, WPT, Bencher), MacOS (Unit Tests, Build libservo), Windows (Unit Tests, Build libservo), Android, OpenHarmony, Lint

Copy link

🐰 Bencher Report

Branch35119/PR
Testbedubuntu-22.04

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkFile Sizemegabytes (MB)Latencymicroseconds (µs)Throughputoperations / second (ops/s)scoreMeasure (units)
Dromaeo/dom📈 view plot
⚠️ NO THRESHOLD
601.92
Dromaeo/dom-attr📈 view plot
⚠️ NO THRESHOLD
4,456.75
Dromaeo/dom-attr/element_expando📈 view plot
⚠️ NO THRESHOLD
62,013.40
Dromaeo/dom-attr/element_expando = value📈 view plot
⚠️ NO THRESHOLD
20,372.60
Dromaeo/dom-attr/element_property📈 view plot
⚠️ NO THRESHOLD
22,272.40
Dromaeo/dom-attr/element_property = value📈 view plot
⚠️ NO THRESHOLD
83.77
Dromaeo/dom-attr/getAttribute📈 view plot
⚠️ NO THRESHOLD
44,024.60
Dromaeo/dom-attr/setAttribute📈 view plot
⚠️ NO THRESHOLD
75.52
Dromaeo/dom-modify📈 view plot
⚠️ NO THRESHOLD
69.19
Dromaeo/dom-modify/appendChild📈 view plot
⚠️ NO THRESHOLD
44.17
Dromaeo/dom-modify/cloneNode📈 view plot
⚠️ NO THRESHOLD
31.20
Dromaeo/dom-modify/createElement📈 view plot
⚠️ NO THRESHOLD
400.59
Dromaeo/dom-modify/createTextNode📈 view plot
⚠️ NO THRESHOLD
138.60
Dromaeo/dom-modify/innerHTML📈 view plot
⚠️ NO THRESHOLD
12.08
Dromaeo/dom-modify/insertBefore📈 view plot
⚠️ NO THRESHOLD
118.72
Dromaeo/dom-query📈 view plot
⚠️ NO THRESHOLD
1,079.15
Dromaeo/dom-query/getElementById📈 view plot
⚠️ NO THRESHOLD
403.00
Dromaeo/dom-query/getElementById (not in document)📈 view plot
⚠️ NO THRESHOLD
522.39
Dromaeo/dom-query/getElementsByName📈 view plot
⚠️ NO THRESHOLD
0.15
Dromaeo/dom-query/getElementsByName (not in document)📈 view plot
⚠️ NO THRESHOLD
0.23
Dromaeo/dom-query/getElementsByTagName (not in document)📈 view plot
⚠️ NO THRESHOLD
59,407.20
Dromaeo/dom-query/getElementsByTagName(*)📈 view plot
⚠️ NO THRESHOLD
46,647.40
Dromaeo/dom-query/getElementsByTagName(a)📈 view plot
⚠️ NO THRESHOLD
46,660.60
Dromaeo/dom-query/getElementsByTagName(div)📈 view plot
⚠️ NO THRESHOLD
43,737.00
Dromaeo/dom-query/getElementsByTagName(p)📈 view plot
⚠️ NO THRESHOLD
47,419.20
Dromaeo/dom-traverse📈 view plot
⚠️ NO THRESHOLD
255.37
Dromaeo/dom-traverse/childNodes📈 view plot
⚠️ NO THRESHOLD
186.27
Dromaeo/dom-traverse/firstChild📈 view plot
⚠️ NO THRESHOLD
260.54
Dromaeo/dom-traverse/lastChild📈 view plot
⚠️ NO THRESHOLD
109.87
Dromaeo/dom-traverse/nextSibling📈 view plot
⚠️ NO THRESHOLD
457.24
Dromaeo/dom-traverse/previousSibling📈 view plot
⚠️ NO THRESHOLD
445.49
Speedometer/Charts-observable-plot📈 view plot
⚠️ NO THRESHOLD
138.41
Speedometer/Charts-observable-plot/Dotted📈 view plot
⚠️ NO THRESHOLD
29.57
Speedometer/Charts-observable-plot/Dotted/Async📈 view plot
⚠️ NO THRESHOLD
2.08
Speedometer/Charts-observable-plot/Dotted/Sync📈 view plot
⚠️ NO THRESHOLD
27.49
Speedometer/Charts-observable-plot/Stacked by 20📈 view plot
⚠️ NO THRESHOLD
61.03
Speedometer/Charts-observable-plot/Stacked by 20/Async📈 view plot
⚠️ NO THRESHOLD
2.84
Speedometer/Charts-observable-plot/Stacked by 20/Sync📈 view plot
⚠️ NO THRESHOLD
58.19
Speedometer/Charts-observable-plot/Stacked by 6📈 view plot
⚠️ NO THRESHOLD
47.81
Speedometer/Charts-observable-plot/Stacked by 6/Async📈 view plot
⚠️ NO THRESHOLD
1.99
Speedometer/Charts-observable-plot/Stacked by 6/Sync📈 view plot
⚠️ NO THRESHOLD
45.82
Speedometer/Geomean📈 view plot
⚠️ NO THRESHOLD
180.69
Speedometer/Iteration-0-Total📈 view plot
⚠️ NO THRESHOLD
321.50
Speedometer/Iteration-1-Total📈 view plot
⚠️ NO THRESHOLD
267.53
Speedometer/Iteration-2-Total📈 view plot
⚠️ NO THRESHOLD
275.83
Speedometer/Iteration-3-Total📈 view plot
⚠️ NO THRESHOLD
270.29
Speedometer/Iteration-4-Total📈 view plot
⚠️ NO THRESHOLD
271.45
Speedometer/Iteration-5-Total📈 view plot
⚠️ NO THRESHOLD
265.74
Speedometer/Iteration-6-Total📈 view plot
⚠️ NO THRESHOLD
267.15
Speedometer/Iteration-7-Total📈 view plot
⚠️ NO THRESHOLD
269.03
Speedometer/Iteration-8-Total📈 view plot
⚠️ NO THRESHOLD
273.03
Speedometer/Iteration-9-Total📈 view plot
⚠️ NO THRESHOLD
274.86
Speedometer/Score📈 view plot
⚠️ NO THRESHOLD
5.54
Speedometer/TodoMVC-Angular📈 view plot
⚠️ NO THRESHOLD
161.87
Speedometer/TodoMVC-Angular/Adding100Items📈 view plot
⚠️ NO THRESHOLD
94.27
Speedometer/TodoMVC-Angular/Adding100Items/Async📈 view plot
⚠️ NO THRESHOLD
9.56
Speedometer/TodoMVC-Angular/Adding100Items/Sync📈 view plot
⚠️ NO THRESHOLD
84.72
Speedometer/TodoMVC-Angular/CompletingAllItems📈 view plot
⚠️ NO THRESHOLD
36.57
Speedometer/TodoMVC-Angular/CompletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
10.09
Speedometer/TodoMVC-Angular/CompletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
26.47
Speedometer/TodoMVC-Angular/DeletingAllItems📈 view plot
⚠️ NO THRESHOLD
31.03
Speedometer/TodoMVC-Angular/DeletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
2.40
Speedometer/TodoMVC-Angular/DeletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
28.63
Speedometer/TodoMVC-JavaScript-ES5📈 view plot
⚠️ NO THRESHOLD
591.59
Speedometer/TodoMVC-JavaScript-ES5/Adding100Items📈 view plot
⚠️ NO THRESHOLD
458.01
Speedometer/TodoMVC-JavaScript-ES5/Adding100Items/Async📈 view plot
⚠️ NO THRESHOLD
19.87
Speedometer/TodoMVC-JavaScript-ES5/Adding100Items/Sync📈 view plot
⚠️ NO THRESHOLD
438.14
Speedometer/TodoMVC-JavaScript-ES5/CompletingAllItems📈 view plot
⚠️ NO THRESHOLD
79.91
Speedometer/TodoMVC-JavaScript-ES5/CompletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
17.81
Speedometer/TodoMVC-JavaScript-ES5/CompletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
62.10
Speedometer/TodoMVC-JavaScript-ES5/DeletingAllItems📈 view plot
⚠️ NO THRESHOLD
53.67
Speedometer/TodoMVC-JavaScript-ES5/DeletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
2.62
Speedometer/TodoMVC-JavaScript-ES5/DeletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
51.05
Speedometer/TodoMVC-JavaScript-ES6-Webpack📈 view plot
⚠️ NO THRESHOLD
863.36
Speedometer/TodoMVC-JavaScript-ES6-Webpack/Adding100Items📈 view plot
⚠️ NO THRESHOLD
696.08
Speedometer/TodoMVC-JavaScript-ES6-Webpack/Adding100Items/Async📈 view plot
⚠️ NO THRESHOLD
9.96
Speedometer/TodoMVC-JavaScript-ES6-Webpack/Adding100Items/Sync📈 view plot
⚠️ NO THRESHOLD
686.11
Speedometer/TodoMVC-JavaScript-ES6-Webpack/CompletingAllItems📈 view plot
⚠️ NO THRESHOLD
98.98
Speedometer/TodoMVC-JavaScript-ES6-Webpack/CompletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
11.18
Speedometer/TodoMVC-JavaScript-ES6-Webpack/CompletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
87.80
Speedometer/TodoMVC-JavaScript-ES6-Webpack/DeletingAllItems📈 view plot
⚠️ NO THRESHOLD
68.31
Speedometer/TodoMVC-JavaScript-ES6-Webpack/DeletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
2.54
Speedometer/TodoMVC-JavaScript-ES6-Webpack/DeletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
65.77
Speedometer/TodoMVC-Preact📈 view plot
⚠️ NO THRESHOLD
63.97
Speedometer/TodoMVC-Preact/Adding100Items📈 view plot
⚠️ NO THRESHOLD
35.94
Speedometer/TodoMVC-Preact/Adding100Items/Async📈 view plot
⚠️ NO THRESHOLD
31.56
Speedometer/TodoMVC-Preact/Adding100Items/Sync📈 view plot
⚠️ NO THRESHOLD
4.37
Speedometer/TodoMVC-Preact/CompletingAllItems📈 view plot
⚠️ NO THRESHOLD
20.67
Speedometer/TodoMVC-Preact/CompletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
14.74
Speedometer/TodoMVC-Preact/CompletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
5.93
Speedometer/TodoMVC-Preact/DeletingAllItems📈 view plot
⚠️ NO THRESHOLD
7.36
Speedometer/TodoMVC-Preact/DeletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
4.83
Speedometer/TodoMVC-Preact/DeletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
2.53
Speedometer/TodoMVC-React📈 view plot
⚠️ NO THRESHOLD
151.22
Speedometer/TodoMVC-React-Redux📈 view plot
⚠️ NO THRESHOLD
175.61
Speedometer/TodoMVC-React-Redux/Adding100Items📈 view plot
⚠️ NO THRESHOLD
75.58
Speedometer/TodoMVC-React-Redux/Adding100Items/Async📈 view plot
⚠️ NO THRESHOLD
9.31
Speedometer/TodoMVC-React-Redux/Adding100Items/Sync📈 view plot
⚠️ NO THRESHOLD
66.26
Speedometer/TodoMVC-React-Redux/CompletingAllItems📈 view plot
⚠️ NO THRESHOLD
65.44
Speedometer/TodoMVC-React-Redux/CompletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
10.56
Speedometer/TodoMVC-React-Redux/CompletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
54.88
Speedometer/TodoMVC-React-Redux/DeletingAllItems📈 view plot
⚠️ NO THRESHOLD
34.59
Speedometer/TodoMVC-React-Redux/DeletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
2.30
Speedometer/TodoMVC-React-Redux/DeletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
32.30
Speedometer/TodoMVC-React/Adding100Items📈 view plot
⚠️ NO THRESHOLD
72.98
Speedometer/TodoMVC-React/Adding100Items/Async📈 view plot
⚠️ NO THRESHOLD
9.91
Speedometer/TodoMVC-React/Adding100Items/Sync📈 view plot
⚠️ NO THRESHOLD
63.07
Speedometer/TodoMVC-React/CompletingAllItems📈 view plot
⚠️ NO THRESHOLD
49.29
Speedometer/TodoMVC-React/CompletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
10.22
Speedometer/TodoMVC-React/CompletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
39.07
Speedometer/TodoMVC-React/DeletingAllItems📈 view plot
⚠️ NO THRESHOLD
28.96
Speedometer/TodoMVC-React/DeletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
2.42
Speedometer/TodoMVC-React/DeletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
26.54
Speedometer/TodoMVC-Svelte📈 view plot
⚠️ NO THRESHOLD
59.09
Speedometer/TodoMVC-Svelte/Adding100Items📈 view plot
⚠️ NO THRESHOLD
33.29
Speedometer/TodoMVC-Svelte/Adding100Items/Async📈 view plot
⚠️ NO THRESHOLD
26.13
Speedometer/TodoMVC-Svelte/Adding100Items/Sync📈 view plot
⚠️ NO THRESHOLD
7.16
Speedometer/TodoMVC-Svelte/CompletingAllItems📈 view plot
⚠️ NO THRESHOLD
17.28
Speedometer/TodoMVC-Svelte/CompletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
12.09
Speedometer/TodoMVC-Svelte/CompletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
5.19
Speedometer/TodoMVC-Svelte/DeletingAllItems📈 view plot
⚠️ NO THRESHOLD
8.51
Speedometer/TodoMVC-Svelte/DeletingAllItems/Async📈 view plot
⚠️ NO THRESHOLD
5.85
Speedometer/TodoMVC-Svelte/DeletingAllItems/Sync📈 view plot
⚠️ NO THRESHOLD
2.67
linux-release📈 view plot
⚠️ NO THRESHOLD
167.71
🐰 View full continuous benchmarking report in Bencher

Copy link

Test results for linux-wpt-layout-2020 from try job (#12904764334):

Flaky unexpected result (17)
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /_webgl/conformance2/rendering/texture-switch-performance.html (#23384)
    • FAIL [expected PASS] subtest: WebGL test #0: Texture switching significantly hurt performance - achieved 680 frames in 2.004 seconds (0.58 times baseline performance)

      assert_true: Texture switching significantly hurt performance - achieved 680 frames in 2.004 seconds (0.58 times baseline performance) expected true got false
      

  • FAIL [expected PASS] /css/css-overflow/line-clamp/line-clamp-021.tentative.html (#35008)
  • FAIL [expected PASS] /css/css-overflow/line-clamp/line-clamp-with-floats-010.tentative.html (#35018)
  • FAIL [expected PASS] /css/css-tables/table-cell-overflow-auto-scrolled.html (#35011)
  • OK /encoding/legacy-mb-japanese/shift_jis/sjis-encode-href.html?1-1000
    • FAIL [expected PASS] subtest: U+30AD キ %83%4C

      assert_equals: expected "%83%4C" but got ""
      

    • FAIL [expected PASS] subtest: U+30AE ギ %83%4D

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30AF ク %83%4E

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30B0 グ %83%4F

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30B1 ケ %83%50

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30B2 ゲ %83%51

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30B3 コ %83%52

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30B4 ゴ %83%53

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30B5 サ %83%54

      str is undefined
      

    • FAIL [expected PASS] subtest: U+30B6 ザ %83%55

      str is undefined
      

    • And 390 more unexpected results...
  • TIMEOUT /fetch/metadata/generated/css-images.https.sub.tentative.html
    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-user

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-storage-access - Same site

      Test timed out
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • FAIL [expected PASS] subtest: Navigating to a different document with link click

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?1" but got "about:blank"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • PASS [expected FAIL] subtest: load event does not fire on window.open('about:blank')
  • OK /html/browsers/windows/browsing-context-names/duplicate-name-order.html (#34623)
    • PASS [expected FAIL] subtest: Duplicate name lookup order
  • ERROR [expected TIMEOUT] /html/canvas/element/manual/imagebitmap/createImageBitmap-serializable.html (#34120)
  • OK /html/interaction/focus/the-autofocus-attribute/document-with-fragment-valid.html (#28259)
    • PASS [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with URL fragments should be skipped.
  • OK /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-nav-location-replace.html (#32604)
    • FAIL [expected PASS] subtest: Navigating iframe loading='lazy' before it is loaded: location.replace

      uncaught exception: Error: assert_equals: expected "http://web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/support/blank.htm?nav" but got "http://web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/support/blank.htm?src"
      

  • OK /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-nav-window-open.html (#32596)
    • FAIL [expected PASS] subtest: Navigating iframe loading='lazy' before it is loaded: location.replace

      uncaught exception: Error: assert_equals: expected "http://web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/support/blank.htm?nav" but got "http://web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/support/blank.htm?src"
      

  • OK /html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html (#29634)
    • PASS [expected FAIL] subtest: Verifies that location navigations take precedence when following form submissions.
  • TIMEOUT [expected OK] /resource-timing/nested-context-navigations-iframe.html (#24311)
    • TIMEOUT [expected PASS] subtest: Test that iframe navigations are not observable by the parent, even after history navigations by the parent

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Test that crossorigin iframe navigations are not observable by the parent, even after history navigations by the parent
    • NOTRUN [expected PASS] subtest: Test that cross-site iframe navigations are not observable by the parent, even after history navigations by the parent
    • NOTRUN [expected PASS] subtest: Test that iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that crossorigin iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that cross-site iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that iframe refreshes are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that crossorigin iframe refreshes are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that cross-site iframe refreshes are not observable by the parent
  • OK [expected TIMEOUT] /webmessaging/without-ports/018.html (#24485)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, javascript:
Stable unexpected results that are known to be intermittent (19)
  • TIMEOUT [expected PASS] /_mozilla/gfx-rs-gecko/descriptor-ranges.html (#23258)
  • OK /fetch/metadata/generated/css-font-face.https.sub.tentative.html (#32732)
    • PASS [expected FAIL] subtest: sec-fetch-user
  • OK /html/browsers/browsing-the-web/navigating-across-documents/009.html (#24456)
    • FAIL [expected PASS] subtest: Link with onclick form submit to javascript url with document.write and href navigation

      assert_array_equals: expected property 1 to be "href" but got "click" (expected array ["write", "href"] got ["write", "click"])
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • PASS [expected FAIL] subtest: Check execution order on load handler
    • PASS [expected FAIL] subtest: Check execution order from nested timeout
  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation expected property 1 to be 3 but got 2 (expected array [6, 3] got [6, 2])
      

  • TIMEOUT [expected ERROR] /html/canvas/element/manual/imagebitmap/createImageBitmap-transfer.html (#34119)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected FAIL] subtest: Host element with delegatesFocus should support autofocus

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • OK /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-nav-location-replace-set-src.html (#32697)
    • PASS [expected FAIL] subtest: Navigating iframe loading='lazy' and then setting src: location.replace
  • OK [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK /html/semantics/forms/historical.html (#28568)
    • FAIL [expected PASS] subtest: <input name=isindex> should not be supported

      assert_regexp_match: expected object "/\?isindex=x$/" but got "about:blank"
      

  • OK /navigation-timing/test-navigation-type-reload.html (#33334)
    • PASS [expected FAIL] subtest: Reload domComplete > Original domComplete
    • PASS [expected FAIL] subtest: Reload domContentLoadedEventEnd > Original domContentLoadedEventEnd
    • PASS [expected FAIL] subtest: Reload domContentLoadedEventStart > Original domContentLoadedEventStart
    • PASS [expected FAIL] subtest: Reload fetchStart > Original fetchStart
    • PASS [expected FAIL] subtest: Reload loadEventEnd > Original loadEventEnd
    • PASS [expected FAIL] subtest: Reload loadEventStart > Original loadEventStart
  • TIMEOUT [expected OK] /performance-timeline/navigation-id-detached-frame.tentative.html (#34773)
    • TIMEOUT [expected PASS] subtest: The navigation_id getter does not crash a window of detached frame

      Test timed out
      

  • OK /resize-observer/change-layout-in-error.html (#32629)
    • PASS [expected FAIL] subtest: Changing layout in window error handler should not result in lifecyle loop when resize observer loop limit is reached.
  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.html (#29053)
    • TIMEOUT [expected PASS] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      Test timed out
      

  • ERROR [expected OK] /workers/constructors/Worker/Worker-constructor.html (#22991)
Stable unexpected results (1)
  • OK /fetch/content-length/api-and-duplicate-headers.any.worker.html
    • FAIL [expected PASS] subtest: fetch() and duplicate Content-Length/Content-Type headers

      promise_test: Unhandled rejection with value: object "TypeError: Network error occurred"
      

Copy link

⚠️ Try run (#12904764334) failed.

@delan delan force-pushed the minimal-winit-example branch from a0c215f to c09c207 Compare January 22, 2025 10:29
@delan delan force-pushed the libservo-webview branch 3 times, most recently from 359b229 to 21ee4b7 Compare January 22, 2025 10:48
@wusyong
Copy link
Member

wusyong commented Jan 23, 2025

How do your vision delegate trait will work with WebView type? I initially thought it's just going to be a WebView trait only with associate type like:

trait WebView {
    type sender;
}

@delan delan force-pushed the minimal-winit-example branch from 2604569 to 4c4493d Compare January 23, 2025 08:53
@delan delan force-pushed the libservo-webview branch 3 times, most recently from 349beb9 to ed5a0c3 Compare January 23, 2025 09:41
@mrobinson
Copy link
Member

How do your vision delegate trait will work with WebView type? I initially thought it's just going to be a WebView trait only with associate type like:

trait WebView {
    type sender;
}

It would work a bit like this:

struct MyWebViewDelegate {
    gui: GuiWhatever,
}

impl WebViewDelegate for MyWebViewDelegate {
    fn set_title(title: &str) {
        gui.set_title(title);
    }
}
let webview = servo.create_webview("http://servo.org/".into());
webview.set_delegate(MyWebViewDelegate::new(gui.clone()));

@delan delan force-pushed the minimal-winit-example branch from fb266f6 to f31cf1f Compare January 23, 2025 11:56
@delan delan force-pushed the libservo-webview branch 2 times, most recently from 34f4edd to d116dd5 Compare January 23, 2025 11:57
@delan delan force-pushed the minimal-winit-example branch from f31cf1f to 7613992 Compare January 23, 2025 11:57
Base automatically changed from minimal-winit-example to main January 23, 2025 12:47
@delan delan force-pushed the libservo-webview branch 2 times, most recently from b155626 to 6c06509 Compare January 24, 2025 05:51
@delan delan changed the base branch from main to ungeneric-servo-and-compositor January 24, 2025 05:51
@delan delan force-pushed the ungeneric-servo-and-compositor branch from 1d2b36b to 914fc3c Compare January 24, 2025 06:46
@wusyong
Copy link
Member

wusyong commented Jan 24, 2025

⚠️ Base branch is not yet main; do not merge ⚠️

Should we review until it's merged to another branch? I've some thought on webview's method, but I suppose it's still not finalized yet.

Base automatically changed from ungeneric-servo-and-compositor to main January 24, 2025 08:13
@delan
Copy link
Member Author

delan commented Jan 24, 2025

Should we review until it's merged to another branch? I've some thought on webview's method, but I suppose it's still not finalized yet.

We’re still experimenting with the API, so we’ll mark it as ready for review once we’re more confident.

@delan delan force-pushed the libservo-webview branch 2 times, most recently from 42bd93d to 8421070 Compare January 24, 2025 10:11
@mrobinson mrobinson changed the title libservo: initial WebView struct API libservo: Add an initial WebView data structure to the API Jan 24, 2025
@mrobinson mrobinson marked this pull request as ready for review January 24, 2025 11:09
@mrobinson
Copy link
Member

@wusyong I'm curious what your thoughts are on the new API. I think we are ready to merge this as the first step.

This patch introduces a new handle-based webview API to libservo, with
two main design goals:

1. The lifetime of the handles controls the lifetime of the webview,
   giving the embedder full control over exactly when webviews are
   created and destroyed. This is consistent with how WebKitGTK’s
   WebView works; the engine can only create webviews via a create
   request, and can only destroy them via a close request.
2. All methods are infallible; if the constellation dies, the embedder
   finds out when calling Servo::handle_events.

For the moment, the embedder is only responsible for creating the
WebView id, and not the internal TopLevelBrowsingContext data
structures. This is so that the ScriptThread is able to get a handle on
the new WebView's WindowProxy in the case that it's an auxiliary
browsing context. In the future, the embedder should also be responsible
for creating the TopLevelBrowsingContext and the ScriptThread should
have mechanism to associate the two views so that WebView creation is
always executed through the same code path in the embedding layer. For
now, it's enough that the embedder can get a handle to the new WebView
when it's creation is requested.

Once we replace EmbedderMsg with a webview delegate trait, we will pass
WebView handles to the embedder, rather than webview ids. We’ll also add
detailed docs, once the design settles.

Signed-off-by: Delan Azabani <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
@mrobinson
Copy link
Member

mrobinson commented Jan 24, 2025

@wusyong Please take another look at this one. While I don't think we can address all your feedback in this change, we hope to address it in followup changes which should come pretty quickly to Servo.

@mrobinson mrobinson added this pull request to the merge queue Jan 25, 2025
Merged via the queue into main with commit 2ce7709 Jan 25, 2025
22 checks passed
@mrobinson mrobinson deleted the libservo-webview branch January 25, 2025 08:50
@wusyong wusyong mentioned this pull request Feb 2, 2025
22 tasks
@mrobinson mrobinson added the A-api Issues dealing with Servo's embedding API label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Issues dealing with Servo's embedding API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants