mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
constellation: focusing and closing webviews (#30842)
* constellation: focusing, closing, and native window visibility * rename “browser” to “webview”, “unfocus” to “blur” * remove native window visibility from constellation * rename more “browser” to “webview” * guard clauses * don’t automatically focus when no webviews are focused * comment spec steps for window.close() * use format interpolation Co-authored-by: Martin Robinson <mrobinson@igalia.com> * fix formatting * rename “Webview” to “WebView” in types and type parameters * remove unused method * fix libsimpleservo --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
6baaa82826
commit
eb95703325
16 changed files with 533 additions and 285 deletions
|
@ -790,13 +790,14 @@ impl WindowMethods for Window {
|
|||
let window = this.root();
|
||||
let document = window.Document();
|
||||
// https://html.spec.whatwg.org/multipage/#closing-browsing-contexts
|
||||
// Step 1, prompt to unload.
|
||||
// Step 1, check if traversable is closing, was already done above.
|
||||
// Steps 2 and 3, prompt to unload for all inclusive descendant navigables.
|
||||
// TODO: We should be prompting for all inclusive descendant navigables,
|
||||
// but we pass false here, which suggests we are not doing that. Why?
|
||||
if document.prompt_to_unload(false) {
|
||||
// Step 2, unload.
|
||||
// Step 4, unload.
|
||||
document.unload(false);
|
||||
// Step 3, remove from the user interface
|
||||
let _ = window.send_to_embedder(EmbedderMsg::CloseBrowser);
|
||||
// Step 4, discard browsing context.
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#a-browsing-context-is-discarded
|
||||
// which calls into https://html.spec.whatwg.org/multipage/#discard-a-document.
|
||||
window.discard_browsing_context();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue