Let Stylist compute and store viewport constraints when setting the device

This commit is contained in:
Till Schneidereit 2015-10-05 17:18:17 +02:00
parent f173504ded
commit f1b6c7cc99
3 changed files with 24 additions and 13 deletions

View file

@ -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);