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:
Delan Azabani 2024-01-24 19:45:54 +08:00 committed by GitHub
parent 6baaa82826
commit eb95703325
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 533 additions and 285 deletions

View file

@ -257,8 +257,13 @@ impl BrowsingContextId {
}
}
#[derive(Clone, Default, Eq, Hash, PartialEq)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct BrowsingContextGroupId(pub u32);
impl fmt::Display for BrowsingContextGroupId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "BrowsingContextGroup{:?}", self)
}
}
thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrowsingContextId>> = Cell::new(None));
@ -266,6 +271,7 @@ thread_local!(pub static TOP_LEVEL_BROWSING_CONTEXT_ID: Cell<Option<TopLevelBrow
Clone, Copy, Deserialize, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd, Serialize,
)]
pub struct TopLevelBrowsingContextId(pub BrowsingContextId);
pub type WebViewId = TopLevelBrowsingContextId;
size_of_test!(TopLevelBrowsingContextId, 8);
size_of_test!(Option<TopLevelBrowsingContextId>, 8);