diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-04-04 19:06:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-04 17:06:34 +0000 |
commit | fb344ba4e9ace1a2ebe09f0fb7c56be1e8ee4720 (patch) | |
tree | f7b85aa0dd1276bd72c4a211a3443b2ee07f76e2 /components/shared/script/script_msg.rs | |
parent | 7c89e24f344fcef5ab858ff752cdd22624b8d66b (diff) | |
download | servo-fb344ba4e9ace1a2ebe09f0fb7c56be1e8ee4720.tar.gz servo-fb344ba4e9ace1a2ebe09f0fb7c56be1e8ee4720.zip |
constellation: Stop assuming that the viewport is shared by all WebViews (#36312)
The `Constellation` previously held a `window_size` member, but this
assumes that all `WebView`s have the same size. This change removes that
assumption as well as making sure that all `WebView`s pass their size
and HiDIP scaling to the `Constellation` when they are created.
In addition
- `WindowSizeData` is renamed to `ViewportDetails`, as it was
holding more than just the size and it didn't necessarily correspond to
a "window." It's used for tracking viewport data, whether for an
`<iframe>` or the main `WebView` viewport.
- `ViewportDetails` is stored more consistently so that conceptually an
`<iframe>` can also have its own HiDPI scaling. This isn't something
we necessarily want, but it makes everything conceptually simpler.
The goal with this change is to work toward allowing per-`WebView` HiDPI
scaling and sizing. There are still some corresponding changes in the
compositor to make that happen, but they will in a subsequent change.
Testing: This is covered by existing tests. There should be no behavior
changes.
Fixes: This is part of #36232.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/shared/script/script_msg.rs')
-rw-r--r-- | components/shared/script/script_msg.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/shared/script/script_msg.rs b/components/shared/script/script_msg.rs index 8baf158312c..9d03ce2509c 100644 --- a/components/shared/script/script_msg.rs +++ b/components/shared/script/script_msg.rs @@ -13,8 +13,9 @@ use base::id::{ use canvas_traits::canvas::{CanvasId, CanvasMsg}; use constellation_traits::{LogEntry, TraversalDirection}; use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; -use embedder_traits::{EmbedderMsg, MediaSessionEvent, TouchEventType, TouchSequenceId}; -use euclid::Size2D; +use embedder_traits::{ + EmbedderMsg, MediaSessionEvent, TouchEventType, TouchSequenceId, ViewportDetails, +}; use euclid::default::Size2D as UntypedSize2D; use ipc_channel::ipc::{IpcReceiver, IpcSender}; use net_traits::CoreResourceMsg; @@ -22,7 +23,6 @@ use net_traits::storage_thread::StorageType; use serde::{Deserialize, Serialize}; use servo_url::{ImmutableOrigin, ServoUrl}; use strum_macros::IntoStaticStr; -use style_traits::CSSPixel; #[cfg(feature = "webgpu")] use webgpu_traits::{WebGPU, WebGPUAdapterResponse}; use webrender_api::ImageKey; @@ -39,8 +39,8 @@ use crate::{ pub struct IFrameSizeMsg { /// The child browsing context for this iframe. pub browsing_context_id: BrowsingContextId, - /// The size of the iframe. - pub size: Size2D<f32, CSSPixel>, + /// The size and scale factor of the iframe. + pub size: ViewportDetails, /// The kind of sizing operation. pub type_: WindowSizeType, } |