style: Rewrite restyling to split between resolving styles and handling changes.

MozReview-Commit-ID: 4BzjbLbFebF
This commit is contained in:
Emilio Cobos Álvarez 2017-07-12 08:40:23 +02:00
parent 0ad2d39c30
commit c6d5dbbb01
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 485 additions and 1500 deletions

View file

@ -2576,11 +2576,11 @@ pub fn cascade(device: &Device,
flags: CascadeFlags,
quirks_mode: QuirksMode)
-> ComputedValues {
debug_assert_eq!(parent_style.is_some(), layout_parent_style.is_some());
debug_assert!(layout_parent_style.is_none() || parent_style.is_some());
let (inherited_style, layout_parent_style) = match parent_style {
Some(parent_style) => {
(parent_style,
layout_parent_style.unwrap())
layout_parent_style.unwrap_or(parent_style))
},
None => {
(device.default_computed_values(),