aboutsummaryrefslogtreecommitdiffstats
path: root/ports/servoshell/egl/ohos/simpleservo.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-04-14 14:01:49 +0200
committerGitHub <noreply@github.com>2025-04-14 12:01:49 +0000
commitc6dc7c83a8d79a180847695aa15f65373868c73e (patch)
tree9df76bd58362cf1e7c801803bd08b8f47989836a /ports/servoshell/egl/ohos/simpleservo.rs
parentf1417c4e75d80c0d07b2718423e042bd11f3bcd3 (diff)
downloadservo-c6dc7c83a8d79a180847695aa15f65373868c73e.tar.gz
servo-c6dc7c83a8d79a180847695aa15f65373868c73e.zip
libservo: Make zooming and HiDPI scaling work per-`WebView` (#36419)
libservo: Make zooming and HiDPI scaling work per-`WebView` This change moves all zooming and HiDPI scaling to work per-`WebView` in both libservo and Compositor. This means that you can pinch zoom one `WebView` and it should now work independently of other `WebView`s. This is accomplished by making each `WebView` in the WebRender scene have its own scaling reference frame. All WebViews are now expected to manage their HiDPI scaling factor and this can be set independently of other WebViews. Perhaps in the future this will become a Servo-wide setting. This allows full removal of the `WindowMethods` trait from Servo. Testing: There are not yet any tests for the WebView API, but I hope to add those soon. Co-authored-by: Shubham Gupta <shubham13297@gmail.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Shubham Gupta <shubham13297@gmail.com>
Diffstat (limited to 'ports/servoshell/egl/ohos/simpleservo.rs')
-rw-r--r--ports/servoshell/egl/ohos/simpleservo.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/ports/servoshell/egl/ohos/simpleservo.rs b/ports/servoshell/egl/ohos/simpleservo.rs
index db9399d8b8d..49c684627c3 100644
--- a/ports/servoshell/egl/ohos/simpleservo.rs
+++ b/ports/servoshell/egl/ohos/simpleservo.rs
@@ -124,7 +124,6 @@ pub fn init(
let window_callbacks = Rc::new(ServoWindowCallbacks::new(
callbacks,
RefCell::new(coordinates),
- options.display_density as f32,
));
let embedder_callbacks = Box::new(ServoEmbedderCallbacks::new(
@@ -138,12 +137,12 @@ pub fn init(
preferences,
rendering_context.clone(),
embedder_callbacks,
- window_callbacks.clone(),
Default::default(),
);
let app_state = RunningAppState::new(
Some(options.url),
+ options.display_density as f32,
rendering_context,
servo,
window_callbacks,