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

Initial internal support for multiple webviews #31417

Merged
merged 57 commits into from
Apr 3, 2024
Merged

Conversation

wusyong
Copy link
Contributor

@wusyong wusyong commented Feb 23, 2024

This patch improves support for multiple top-level browsing contexts aka “webviews” by adding several messages that allow the embedder to show, hide, move, and resize webviews in the compositor, and notify the embedder when painting order and focus changes.

This is a rebased version of #30648, while addressing review feedback given in #30767, #30840, #30841, and #30842. Notably, “browsers” have been renamed to “webviews”.

There are no user-facing changes in servoshell yet, but these changes can be used to create a multiple-document interface (#30785) or implement tabbed browsing (#31545). For the full design of this feature, see #30648.

limitations

  • desktop-style page zoom is still global
  • browsers with transparent or translucent content will misbehave
  • sending ShowWebView and HideWebView for one webview at a time can be inefficient
  • if too many webviews are shown at once, the compositor can get stuck in a laggy state with pending epoch warnings (to reproduce, try #31545 with 4.html and click “_blank” six or seven times)

compositor

  • WebViewManager (new) manages webview-related storage and painting order
    • it allows the compositor to store arbitrary data for each webview id
    • it keeps track of which webviews are visible, and what order to paint them in
  • we now use the iframe-in-dummy-root-pipeline technique to composite the webviews together, not just when we have a non-unity pinch zoom

servoshell

  • WebViewManager (was WebView) keeps a copy of the webview rects and focus
  • but for now, we always focus and show the newest webview only

messages

embedder → compositor (no ipc)

  • WindowResize (was Resize) no longer affects the viewport of individual webviews
  • Zoom (existing) no longer affects the viewport of individual webviews
  • ResetZoom (existing) no longer affects the viewport of individual webviews
  • MoveResizeWebView (new) updates a webview’s rect, and sends new viewport to script in descendant pipelines
  • ShowWebView (new) adds a webview to painting order, and notifies embedder of the new painting order
  • HideWebView (new) removes a webview from painting order, and notifies embedder of the new painting order
  • RaiseWebViewToTop (new) moves a webview to the top of the painting order, and notifies embedder accordingly

embedder →* constellation

  • SetWebViewThrottled (was WindowVisibility) has been reworked to be less confusing (#31815, #31816)

constellation → compositor

  • CreateOrUpdateWebView (was SetFrameTree) now adds or updates a webview without clobbering others
  • RemoveWebView (new) removes a webview from .webviews and .pipeline_details
  • MoveResizeWebView (new) updates a webview’s rect, and sends new viewport to script in descendant pipelines
  • ShowWebView (new) adds a webview to painting order, and notifies embedder of the new painting order
  • HideWebView (new) removes a webview from painting order, and notifies embedder of the new painting order
  • RaiseWebViewToTop (new) moves a webview to the top of the painting order, and notifies embedder accordingly

embedder ← constellation ←* compositor

  • ReadyToPresent (existing) now takes a vec of the ids of all visible webviews in painting order

* all of these are in the same enum ConstellationMsg (components/shared/compositing/constellation_msg.rs), which is a very confusing design that conflates the embedder with the compositor


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes are related to [meta] embedding #30593
  • There are tests for these changes OR
  • These changes do not require tests because ___

Co-authored-by: Delan Azabani <dazabani@igalia.com>
There are some variable and comments still use browser as names.
This commit renames them to webview.
@wusyong
Copy link
Contributor Author

wusyong commented Feb 27, 2024

@delan I think the PR is ready to review now. Could you review it if you have time?
The last thing I'm not sure is WebViewVisibilityChanged. Should it be removed in favor of ShowWebView and HideWebView variants?

@delan delan self-requested a review March 6, 2024 06:43
@delan
Copy link
Sponsor Member

delan commented Mar 6, 2024

The last thing I'm not sure is WebViewVisibilityChanged. Should it be removed in favor of ShowWebView and HideWebView variants?

WebViewVisibilityChanged notifies script that a webview has become invisible due to the native window or app activity, whereas ShowWebView and HideWebView tell the compositor to add or remove it from webrender (and notifies script of the new visibility, taking native window visibility into account). I think we should keep it for now, but I’m open to changing the model if something else makes more sense, like @mrobinson did in #30842 (9e307cf).

Copy link
Sponsor Member

@delan delan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for rebasing this, it’s coming along well. I’ve edited in a description of the changes in this patch, and updated the description in #30648.

I guess we either need to finish and enable the multiview feature in this patch, or fix the viewport coordinates when multiview is disabled, but given how old this patch is getting I think we should do the latter.

components/servo/lib.rs Outdated Show resolved Hide resolved
components/constellation/webview.rs Outdated Show resolved Hide resolved
components/constellation/constellation.rs Outdated Show resolved Hide resolved
components/constellation/webview.rs Outdated Show resolved Hide resolved
components/compositing/compositor.rs Outdated Show resolved Hide resolved
@delan delan changed the title Add multiple concurrent top-level browsing contexts Initial internal support for multiple webviews Mar 7, 2024
@delan delan mentioned this pull request Mar 7, 2024
39 tasks
@delan
Copy link
Sponsor Member

delan commented Mar 7, 2024

While testing these changes, I thought I found another regression with multiview disabled, but it actually affects main too (#31539), so I opened #31541 to make it easier to play with our multiview work.

Replace visible_webviews and native_window_is_visible with shown_webviews
and invisible_webviews. Add 4 more methods to set them accordingly. The
behavior of is_effectively_visible will return true if the wbview is in
shown_webviews set but not in invisible_webviews.
Copy link
Sponsor Member

@delan delan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great updates, this is almost ready!

components/constellation/webview.rs Outdated Show resolved Hide resolved
components/script/dom/bindings/buffer_source.rs Outdated Show resolved Hide resolved
ports/servoshell/app.rs Outdated Show resolved Hide resolved
components/shared/compositing/lib.rs Outdated Show resolved Hide resolved
components/shared/compositing/lib.rs Outdated Show resolved Hide resolved
components/shared/compositing/constellation_msg.rs Outdated Show resolved Hide resolved
components/shared/compositing/constellation_msg.rs Outdated Show resolved Hide resolved
components/shared/compositing/constellation_msg.rs Outdated Show resolved Hide resolved
components/shared/compositing/constellation_msg.rs Outdated Show resolved Hide resolved
components/shared/embedder/lib.rs Outdated Show resolved Hide resolved
@wusyong wusyong requested a review from delan March 8, 2024 03:37
@delan delan added the T-linux-wpt-2020 Do a try run of the WPT label Mar 8, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

🔨 Triggering try run (#8198742693) for Linux WPT

Copy link

github-actions bot commented Apr 3, 2024

🔨 Triggering try run (#8533457028) for Linux WPT

@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@delan delan added the T-linux-wpt-2020 Do a try run of the WPT label Apr 3, 2024
@github-actions github-actions bot removed the T-linux-wpt-2020 Do a try run of the WPT label Apr 3, 2024
@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

Copy link

github-actions bot commented Apr 3, 2024

🔨 Triggering try run (#8533487478) for Linux WPT

Copy link

github-actions bot commented Apr 3, 2024

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

Flaky unexpected result (23)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected PASS] /css/css-fonts/font-size-adjust-reload.html (#30678)
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • PASS [expected FAIL] subtest: Matching font-stretch: '110%' should prefer '110% 120%' over '115% 116%'
    • PASS [expected FAIL] subtest: Matching font-style: 'normal' should prefer 'oblique 0deg' over 'oblique 10deg 40deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 21deg' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 10deg' should prefer 'oblique 10deg' over 'oblique 5deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 10deg' should prefer 'oblique 5deg' over 'oblique 15deg 20deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 10deg' should prefer 'oblique 15deg 20deg' over 'oblique 30deg 60deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 0deg' should prefer 'italic' over 'oblique -50deg -20deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique -21deg' should prefer 'italic' over 'oblique 0deg'
  • OK /css/cssom-view/MediaQueryList-addListener-removeListener.html (#24569)
    • PASS [expected FAIL] subtest: listeners are called correct number of times
  • OK /css/cssom-view/matchMedia.html (#31428)
    • PASS [expected FAIL] subtest: iframe.matchMedia("(width: 200px)") matches
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • PASS [expected TIMEOUT] subtest: background-image sec-fetch-site - HTTPS downgrade (header not sent)
  • OK /fetch/private-network-access/worker-blob-fetch.tentative.window.html (#30064)
    • PASS [expected FAIL] subtest: local https to local https: success.
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • FAIL [expected PASS] subtest: Check execution order from nested timeout

      assert_equals: Expected nested setTimeout to run second expected true but got false
      

    • FAIL [expected PASS] subtest: Check execution order on load handler

      assert_equals: Expected onload to run first expected false but got true
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • PASS [expected FAIL] subtest: Navigating to a different document with link click
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • FAIL [expected PASS] subtest: load event does not fire on window.open('about:blank')

      assert_unreached: load should not be fired Reached unreachable code
      

  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.html (#29081)
    • PASS [expected TIMEOUT] subtest: no-referrer referrer policy used to create the starting page
  • OK /html/browsers/browsing-the-web/overlapping-navigations-and-traversals/cross-document-nav-cross-document-nav.html (#29181)
    • PASS [expected FAIL] subtest: cross-document navigation then cross-document navigation
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.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 5 but got 3 (expected array [6, 5] got [6, 3])
      

  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
  • OK [expected TIMEOUT] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • PASS [expected TIMEOUT] subtest: reparent-form-during-planned-navigation-task
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • PASS [expected FAIL] subtest: The end: DOMContentLoaded and defer scripts
  • OK /html/webappapis/dynamic-markup-insertion/document-write/module-delayed.html (#27659)
    • FAIL [expected PASS] subtest: async document.write in a module

      assert_true: onload must be called expected true got false
      

  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • TIMEOUT [expected FAIL] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document

      Test timed out
      

  • ERROR /resource-timing/content-type-parsing.html (#29131)
    • FAIL [expected TIMEOUT] subtest: mime-type 16 : text/html;charset=�gbk

      assert_equals: expected (string) "text/html" but got (undefined) undefined
      

    • TIMEOUT [expected NOTRUN] subtest: mime-type 17 : text/html;charset= gbk

      Test timed out
      

  • TIMEOUT /resource-timing/test_resource_timing.html (#25720)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img)

      assert_equals: expected 11226880 but got 11227136
      

  • OK [expected TIMEOUT] /webmessaging/with-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank
Stable unexpected results that are known to be intermittent (12)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load &amp; pageshow events do not fire on contentWindow of &lt;iframe&gt; element created with src=''

      assert_unreached: load should not be fired Reached unreachable code
      

  • PASS [expected CRASH] /html/canvas/element/manual/drawing-text-to-the-canvas/canvas.2d.disconnected-font-size-math.html (#30063)
  • FAIL [expected CRASH] /html/canvas/element/manual/text/canvas.2d.disconnected.html (#30063)
  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: Basic File test (formdata event)
    • PASS [expected FAIL] subtest: text/plain: double quote in value (normal form)
  • OK [expected CRASH] /html/semantics/forms/the-fieldset-element/disabled-003.html (#31730)
  • OK [expected ERROR] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img)

Copy link

github-actions bot commented Apr 3, 2024

✨ Try run (#8533457028) succeeded.

Copy link

github-actions bot commented Apr 3, 2024

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

Flaky unexpected result (16)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • PASS [expected FAIL] subtest: Matching font-style: 'normal' should prefer 'normal' over 'oblique 0deg'
  • PASS [expected FAIL] /css/css-sizing/dynamic-available-size-iframe.html (#31559)
  • OK /css/cssom-view/MediaQueryList-addListener-removeListener.html (#24569)
    • PASS [expected FAIL] subtest: listeners are called correct number of times
  • TIMEOUT [expected OK] /custom-elements/reactions/customized-builtins/HTMLMediaElement.html (#31014)
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/history-traversal/srcdoc/consecutive-srcdoc.html (#29084)
    • TIMEOUT [expected FAIL] subtest: changing srcdoc to about:srcdoc#yo then another srcdoc does two push navigations and we can navigate back

      Test timed out
      

  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.html (#29081)
    • PASS [expected TIMEOUT] subtest: no-referrer referrer policy used to create the starting page
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html (#24057)
  • OK /html/semantics/embedded-content/the-img-element/non-active-document.html (#21544)
    • FAIL [expected PASS] subtest: DOMParser

      assert_unreached: got unexpected load event Reached unreachable code
      

    • FAIL [expected PASS] subtest: createHTMLDocument

      assert_unreached: got unexpected error event Reached unreachable code
      

    • FAIL [expected PASS] subtest: &lt;template&gt;

      assert_unreached: got unexpected error event Reached unreachable code
      

  • OK /html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-standards-mode.html (#21666)
    • PASS [expected FAIL] subtest: &lt;img srcset="/images/green-1x1.png?e38 50w, /images/green-16x16.png?e38 51w" sizes="(min-width:calc(0)) 1px"&gt; ref sizes="1px" (standards mode)
  • OK /html/semantics/forms/form-submission-0/multipart-formdata.window.html (#28725)
    • PASS [expected FAIL] subtest: multipart/form-data: single quote in value (normal form)
  • OK [expected TIMEOUT] /webmessaging/with-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 (17)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • FAIL [expected PASS] /_mozilla/css/iframe/hide_and_show.html (#15265)
  • FAIL [expected PASS] /_mozilla/mozilla/iframe/resize_after_load.html (#13573)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/cssom-view/MediaQueryList-extends-EventTarget-interop.html (#25285)
    • FAIL [expected PASS] subtest: listener added with addListener and addEventListener is called once

      assert_equals: triggerMQLEvent expected 1 but got 0
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • PASS [expected FAIL] subtest: load &amp; pageshow events do not fire on contentWindow of &lt;iframe&gt; element created with src='about:blank'
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored

      promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.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 5 but got 3 (expected array [6, 5] got [6, 3])
      

  • PASS [expected CRASH] /html/canvas/element/manual/drawing-text-to-the-canvas/canvas.2d.disconnected-font-size-math.html (#30063)
  • FAIL [expected CRASH] /html/canvas/element/manual/text/canvas.2d.disconnected.html (#30063)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/media-elements/event_timeupdate_noautoplay.html (#25046)
    • NOTRUN [expected PASS] subtest: calling play() on a sufficiently long audio should trigger timeupdate event
    • NOTRUN [expected PASS] subtest: calling play() on a sufficiently long video should trigger timeupdate event
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
  • OK [expected TIMEOUT] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html (#29724)
    • PASS [expected TIMEOUT] subtest: reparent-form-during-planned-navigation-task
  • OK [expected CRASH] /html/semantics/forms/the-fieldset-element/disabled-003.html (#31730)
  • OK [expected ERROR] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • OK [expected TIMEOUT] /webmessaging/with-ports/017.html (#24486)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, about:blank

Copy link

github-actions bot commented Apr 3, 2024

✨ Try run (#8533487478) succeeded.

@delan
Copy link
Sponsor Member

delan commented Apr 3, 2024

Reproduced in more detail:

CrashLog([(Instant { tv_sec: 1396, tv_nsec: 738662526 }, Add(TopLevel(0,1))), (Instant { tv_sec: 1396, tv_nsec: 738664760 }, Show(TopLevel(0,1))), (Instant { tv_sec: 1397, tv_nsec: 798459860 }, HideAll), (Instant { tv_sec: 1397, tv_nsec: 798460001 }, RaiseToTop(TopLevel(0,1))), (Instant { tv_sec: 1397, tv_nsec: 836144678 }, Remove(TopLevel(0,1))), (Instant { tv_sec: 1397, tv_nsec: 836168353 }, HideAll), (Instant { tv_sec: 1397, tv_nsec: 836168422 }, Show(TopLevel(0,1)))]) (thread main, at /home/runner/work/servo/servo/components/compositing/webview.rs:100)
  • (Instant { tv_sec: 1396, tv_nsec: 738662526 }, Add(TopLevel(0,1)))
  • (Instant { tv_sec: 1396, tv_nsec: 738664760 }, Show(TopLevel(0,1)))
  • (Instant { tv_sec: 1397, tv_nsec: 798459860 }, HideAll)
  • (Instant { tv_sec: 1397, tv_nsec: 798460001 }, RaiseToTop(TopLevel(0,1)))
  • (Instant { tv_sec: 1397, tv_nsec: 836144678 }, Remove(TopLevel(0,1)))
  • (Instant { tv_sec: 1397, tv_nsec: 836168353 }, HideAll)
  • (Instant { tv_sec: 1397, tv_nsec: 836168422 }, Show(TopLevel(0,1)))

@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@delan
Copy link
Sponsor Member

delan commented Apr 3, 2024

fail https://github.com/wusyong/servo/actions/runs/8534437489/job/23378836637

  1. libservo creates an IOCompositor, which adds and shows webview (0,1)
  2. servoshell handles WebViewOpened by
    • sending the constellation a FocusWebView((0,1))
    • sending the compositor a RaiseWebViewToTop((0,1), true)
  3. compositor handles RaiseWebViewToTop by hiding all webviews and raising webview (0,1) to top
  4. compositor receives RemoveWebView from constellation and handles it by removing webview (0,1)
  5. servoshell handles WebViewFocused by sending the compositor a ShowWebView((0,1), true)
  6. compositor handles ShowWebView by hiding all webviews and showing webview (0,1)
  7. compositor panics
CrashLog([
CrashLogEntry { instant: Instant { tv_sec: 1598, tv_nsec: 935719235 }, operation: Add(TopLevel(0,1)), backtrace: Backtrace [
{ fn: "compositing::webview::CrashLog::push" }, 
{ fn: "compositing::webview::WebViewManager<WebView>::add" }, 
{ fn: "compositing::compositor::IOCompositor<Window>::create" }, 
{ fn: "servo::Servo<Window>::new" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run" }, 
{ fn: "winit::platform_impl::platform::EventLoop<T>::run" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever" }, 
{ fn: "servoshell::app::App::run" }, 
{ fn: "servoshell::main" }] }, 
CrashLogEntry { instant: Instant { tv_sec: 1598, tv_nsec: 937471407 }, operation: Show(TopLevel(0,1)), backtrace: Backtrace [
{ fn: "compositing::webview::CrashLog::push" }, 
{ fn: "compositing::compositor::IOCompositor<Window>::create" }, 
{ fn: "servo::Servo<Window>::new" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run" }, 
{ fn: "winit::platform_impl::platform::EventLoop<T>::run" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever" }, 
{ fn: "servoshell::app::App::run" }, 
{ fn: "servoshell::main" }] }, 
CrashLogEntry { instant: Instant { tv_sec: 1598, tv_nsec: 938809020 }, operation: HideAll, backtrace: Backtrace [
{ fn: "compositing::webview::CrashLog::push" }, 
{ fn: "compositing::compositor::IOCompositor<Window>::raise_webview_to_top" }, 
{ fn: "servo::Servo<Window>::handle_events" }, 
{ fn: "servoshell::app::App::handle_events" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run" }, 
{ fn: "winit::platform_impl::platform::EventLoop<T>::run" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever" }, 
{ fn: "servoshell::app::App::run" }, 
{ fn: "servoshell::main" }] }, 
CrashLogEntry { instant: Instant { tv_sec: 1598, tv_nsec: 939061422 }, operation: RaiseToTop(TopLevel(0,1)), backtrace: Backtrace [
{ fn: "compositing::webview::CrashLog::push" }, 
{ fn: "compositing::webview::WebViewManager<WebView>::raise_to_top" }, 
{ fn: "compositing::compositor::IOCompositor<Window>::raise_webview_to_top" }, 
{ fn: "servo::Servo<Window>::handle_events" }, 
{ fn: "servoshell::app::App::handle_events" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run" }, 
{ fn: "winit::platform_impl::platform::EventLoop<T>::run" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever" }, 
{ fn: "servoshell::app::App::run" }, 
{ fn: "servoshell::main" }] }, 
CrashLogEntry { instant: Instant { tv_sec: 1599, tv_nsec: 835868951 }, operation: Remove(TopLevel(0,1)), backtrace: Backtrace [
{ fn: "compositing::webview::CrashLog::push" }, 
{ fn: "compositing::webview::WebViewManager<WebView>::remove" }, 
{ fn: "compositing::compositor::IOCompositor<Window>::receive_messages" }, 
{ fn: "servo::Servo<Window>::handle_events" }, 
{ fn: "servoshell::app::App::handle_events" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::drain_events::{{closure}}::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::event_processor::EventProcessor<T>::process_event" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run" }, 
{ fn: "winit::platform_impl::platform::EventLoop<T>::run" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever" }, 
{ fn: "servoshell::app::App::run" }, 
{ fn: "servoshell::main" }] }, 
CrashLogEntry { instant: Instant { tv_sec: 1599, tv_nsec: 836099380 }, operation: HideAll, backtrace: Backtrace [
{ fn: "compositing::webview::CrashLog::push" }, 
{ fn: "compositing::compositor::IOCompositor<Window>::show_webview" }, 
{ fn: "servo::Servo<Window>::handle_events" }, 
{ fn: "servoshell::app::App::handle_events" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::drain_events::{{closure}}::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::event_processor::EventProcessor<T>::process_event" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run" }, 
{ fn: "winit::platform_impl::platform::EventLoop<T>::run" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever" }, 
{ fn: "servoshell::app::App::run" }, 
{ fn: "servoshell::main" }] }, 
CrashLogEntry { instant: Instant { tv_sec: 1599, tv_nsec: 836201541 }, operation: Show(TopLevel(0,1)), backtrace: Backtrace [
{ fn: "compositing::webview::CrashLog::push" }, 
{ fn: "compositing::compositor::IOCompositor<Window>::show_webview" }, 
{ fn: "servo::Servo<Window>::handle_events" }, 
{ fn: "servoshell::app::App::handle_events" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::drain_events::{{closure}}::{{closure}}" }, 
{ fn: "winit::platform_impl::platform::x11::event_processor::EventProcessor<T>::process_event" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run_return::single_iteration" }, 
{ fn: "winit::platform_impl::platform::x11::EventLoop<T>::run" }, 
{ fn: "winit::platform_impl::platform::EventLoop<T>::run" }, 
{ fn: "servoshell::events_loop::EventsLoop::run_forever" }, 
{ fn: "servoshell::app::App::run" }, 
{ fn: "servoshell::main" }] }]) (thread main, at /home/runner/work/servo/servo/components/compositing/webview.rs:115)

@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@servo-wpt-sync
Copy link
Collaborator

🛠 These changes could not be applied onto the latest upstream WPT. Servo's copy of the Web Platform Tests may be out of sync.

@delan delan enabled auto-merge April 3, 2024 10:58
@delan delan added this pull request to the merge queue Apr 3, 2024
Merged via the queue into servo:main with commit 66878fb Apr 3, 2024
9 checks passed
@wusyong wusyong deleted the multi-tlbc branch April 8, 2024 05:28
@wusyong wusyong restored the multi-tlbc branch April 8, 2024 05:28
@wusyong
Copy link
Contributor Author

wusyong commented Apr 8, 2024

@delan Thanks for addressing the rest of the issues in the PR! I was absent last week, but I'll catch up in the next few days.
And hopefully try to see if I can work on multiple views in same window from my project as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants