mirror of
https://github.com/servo/servo.git
synced 2025-06-19 14:48:59 +01:00
Add support for parsing and applying viewport
<meta>
(#35901)
This patch comprises following steps: 1. Parses the `viewport` Attribute from `<meta>`. 2. Creates a `ViewportDescription` struct. 3. Populate values into Viewport struct. 4. Pass & Stash Viewport Description to Webview. 5. Process parsed values of `viewport <meta>` Testing: Tested locally. Fixes: #36159 --------- Signed-off-by: Shubham Gupta <shubham13297@gmail.com> Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com> Co-authored-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
This commit is contained in:
parent
c7a215faba
commit
aff2a85372
6 changed files with 248 additions and 19 deletions
|
@ -23,6 +23,7 @@ use webrender_api::DocumentId;
|
|||
|
||||
pub mod display_list;
|
||||
pub mod rendering_context;
|
||||
pub mod viewport_description;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
@ -42,6 +43,8 @@ use webrender_api::{
|
|||
ImageKey, NativeFontHandle, PipelineId as WebRenderPipelineId,
|
||||
};
|
||||
|
||||
use crate::viewport_description::ViewportDescription;
|
||||
|
||||
/// Sends messages to the compositor.
|
||||
#[derive(Clone)]
|
||||
pub struct CompositorProxy {
|
||||
|
@ -176,6 +179,8 @@ pub enum CompositorMsg {
|
|||
/// Measure the current memory usage associated with the compositor.
|
||||
/// The report must be sent on the provided channel once it's complete.
|
||||
CollectMemoryReport(ReportsChan),
|
||||
/// A top-level frame has parsed a viewport metatag and is sending the new constraints.
|
||||
Viewport(WebViewId, ViewportDescription),
|
||||
}
|
||||
|
||||
impl Debug for CompositorMsg {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue