-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
servoshell: Add architectural support for opening multiple windows #40883
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
Conversation
69e9047 to
84f243a
Compare
Could you clarify the implications (of "expected") here? For ohos we definitly want / need multiple windows, and I would assume android would have similar use-cases for multiple windows. |
Ah, interesting. There is no reason that the embedded platforms cannot have more than one window in servoshell. We just did not plan to add interface elements to allow that -- and aren't certain what it means in fullscreen servoshell. From the perspective of Servo itself, creating multiple |
ohos / android don't necessiraly imply full screen. There are many device types, from normal smartphone, over foldables to tablets or even PCs. For the larger device-types (IMHO starting from foldable), having multi-window support makes sense, to support side-by-side viewing of different websites. (Split screen also works on my normal android phone as a top/bottom split, but imho it doesn't make too much sense without a foldable, since half the screen space is quite small)
Thanks for clarifying! Another question - I've not been following the previous PRs, but is the servo backend using one webrender instance per rendering-context now, or just a single webrender instance? Edit: To maybe clarify a bit more on the ohos use-case. As you know we primarily care about the webview use-case (where multi-window is obviously important), but being able to run servoshell with multiple windows would allow us to easily test multi-window functionality in servoshell upstream. |
Servo is using one WR instance per rendering-context. Using multiple documents (one per webview) in a single WebRender instance has issues. We've let Mozilla GFX team know about those and they are discussing internally if that is something that they can/want to support and how this fits into WR's roadmap. |
Oh, for sure. We would need a bit more work to add multi-windows support for Android / OHOS servoshell as the interface elements aren't really there. Multi-window support will definitely be available on these platforms, but maybe not in the short-term for servoshell itself. |
07dfa50 to
ac557d0
Compare
|
🔨 Triggering try run (#19708809664) for Linux (WPT), Android, OpenHarmony |
|
Test results for linux-wpt from try job (#19708809664): Flaky unexpected result (27)
Stable unexpected results that are known to be intermittent (29)
|
This change is a major re-architecture of servoshell to support multiple windows. Unfortunately it was not possible to do this incrementally, but @mukilan and I did this together so we feel more confident about these changes. The main change here is that now the `HashMap` of windows that `App` has can be filled with more than one `ServoShellWindow`. `ServoShellWindow` is a wrapper around a `PlatformWindow` which can either be headed, headless, or for embedded platforms. Embedded platforms (Android and OHOS) are only expected to have a single window, but there is no reason that more windows cannot be added. This change enables the embedded and desktop versions of servoshell to start to be fully integrated so that the entire `RunningAppState` is shared between them. Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com>
ac557d0 to
ea91dd1
Compare
|
🔨 Triggering try run (#19713821795) for OpenHarmony |
|
✨ Try run (#19713821795) succeeded. |
|
FYI, the one failing ohos test is also failing on main (most of the time), so the panic seems to have been fixed. |
|
I've tested this on NixOS+KDE+Wayland and found an issue. When the window is closed, the app seems to "hang" and I get the following backtrace in the console: I think this happens when servo instance is shutdown before the JS runtime gets destroyed. I'll try to dig deeper. |
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
I think I've tracked this down to the order we were letting things go when a window was removed. I've modified the code to schedule a window close instead of doing it immediately. I think this allows things to be released in the right order and I no longer see this issue on my Linux system. |
|
Wanted to confirm that it works currently on ohos. The only thing that doesn't work is the make new tab feature. I think it is fine to disable it for now and fix it later. |
Do you have any more details on errors that are emitted when using the new tab feature? Maybe we can fix it before landing this? |
|
I suspect that that if the new tab feature is broken by the ordering of WebViews in the collection, that it will be fixed by a followup change. I'll go ahead and land this. |
… cleanly This is a speculative fix for a crash mentioned by @mukilan[^1]. It will also make moving to a more consistent shutdown model (even one driven by dropping of the `Servo` instance) possible. [^1]: servo#40883 (comment) Signed-off-by: Martin Robinson <mrobinson@igalia.com>
… cleanly (#40933) This is a speculative fix for a crash mentioned by @mukilan[^1]. It will also make moving to a more consistent shutdown model (even one driven by dropping of the `Servo` instance) possible. [^1]: #40883 (comment) Testing: It's difficult to test this crash because it seems to only happen on nixOS and we currently don't have a good way to test crashes on exit. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This change is a major re-architecture of servoshell to support multiple
windows. Unfortunately it was not possible to do this incrementally, but
@mukilan and I did this together so we feel more confident about these
changes.
The main change here is that now the
HashMapof windows thatApphas can be filled with more than one
ServoShellWindow.ServoShellWindowis a wrapper around aPlatformWindowwhich caneither be headed, headless, or for embedded platforms. Embedded
platforms (Android and OHOS) are only expected to have a single window,
but there is no reason that more windows cannot be added.
There is still a little bit more work to be done in order to fully enable
mulitple windows, so this change is just the architectural preparation.
This change enables the embedded and desktop versions of servoshell to
start to be fully integrated so that the entire
RunningAppStateisshared between them.
Testing: servoshell is the test harness so these changes are covered
by the WPT tests.