mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Let Stylist compute and store viewport constraints when setting the device
This commit is contained in:
parent
f173504ded
commit
f1b6c7cc99
3 changed files with 24 additions and 13 deletions
|
@ -1077,7 +1077,7 @@ impl LayoutTask {
|
|||
flow_ref::deref_mut(layout_root));
|
||||
let root_size = {
|
||||
let root_flow = flow::base(&**layout_root);
|
||||
if rw_data.stylist.constrain_viewport().is_some() {
|
||||
if rw_data.stylist.get_viewport_constraints().is_some() {
|
||||
root_flow.position.size.to_physical(root_flow.writing_mode)
|
||||
} else {
|
||||
root_flow.overflow.size
|
||||
|
@ -1164,7 +1164,7 @@ impl LayoutTask {
|
|||
let device = Device::new(MediaType::Screen, initial_viewport);
|
||||
rw_data.stylist.set_device(device);
|
||||
|
||||
let constraints = rw_data.stylist.constrain_viewport();
|
||||
let constraints = rw_data.stylist.get_viewport_constraints();
|
||||
rw_data.viewport_size = match constraints {
|
||||
Some(ref constraints) => {
|
||||
debug!("Viewport constraints: {:?}", constraints);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue