layout: Store viewport and screen size separately.

Fixes a bug whereby all nodes would get unconditionally reflowed on
every layout event if the page set a viewport.
This commit is contained in:
Patrick Walton 2015-11-02 14:00:52 -08:00
parent 1e3010e4cd
commit 3ae5f04bd1
4 changed files with 50 additions and 37 deletions

View file

@ -463,7 +463,7 @@ impl<'ln> PrivateMatchMethods for LayoutNode<'ln> {
None => None,
Some(ref style) => Some(&**style),
};
let (the_style, is_cacheable) = cascade(layout_context.screen_size,
let (the_style, is_cacheable) = cascade(layout_context.viewport_size,
applicable_declarations,
shareable,
Some(&***parent_style),
@ -472,7 +472,7 @@ impl<'ln> PrivateMatchMethods for LayoutNode<'ln> {
this_style = the_style
}
None => {
let (the_style, is_cacheable) = cascade(layout_context.screen_size,
let (the_style, is_cacheable) = cascade(layout_context.viewport_size,
applicable_declarations,
shareable,
None,