mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
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>
This commit is contained in:
parent
7c89e24f34
commit
fb344ba4e9
26 changed files with 272 additions and 256 deletions
|
@ -5,9 +5,8 @@
|
|||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
use base::id::{BrowsingContextGroupId, BrowsingContextId, PipelineId, WebViewId};
|
||||
use euclid::Size2D;
|
||||
use embedder_traits::ViewportDetails;
|
||||
use log::warn;
|
||||
use style_traits::CSSPixel;
|
||||
|
||||
use crate::pipeline::Pipeline;
|
||||
|
||||
|
@ -50,8 +49,8 @@ pub struct BrowsingContext {
|
|||
/// The top-level browsing context ancestor
|
||||
pub top_level_id: WebViewId,
|
||||
|
||||
/// The size of the frame.
|
||||
pub size: Size2D<f32, CSSPixel>,
|
||||
/// The [`ViewportDetails`] of the frame that this [`BrowsingContext`] represents.
|
||||
pub viewport_details: ViewportDetails,
|
||||
|
||||
/// Whether this browsing context is in private browsing mode.
|
||||
pub is_private: bool,
|
||||
|
@ -85,7 +84,7 @@ impl BrowsingContext {
|
|||
top_level_id: WebViewId,
|
||||
pipeline_id: PipelineId,
|
||||
parent_pipeline_id: Option<PipelineId>,
|
||||
size: Size2D<f32, CSSPixel>,
|
||||
viewport_details: ViewportDetails,
|
||||
is_private: bool,
|
||||
inherited_secure_context: Option<bool>,
|
||||
throttled: bool,
|
||||
|
@ -96,7 +95,7 @@ impl BrowsingContext {
|
|||
bc_group_id,
|
||||
id,
|
||||
top_level_id,
|
||||
size,
|
||||
viewport_details,
|
||||
is_private,
|
||||
inherited_secure_context,
|
||||
throttled,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue