style: Add a special, explicit path for lazy style resolution and use it for GetComputedStyle.

MozReview-Commit-ID: KAM9mVoxCHE
This commit is contained in:
Bobby Holley 2016-12-28 11:21:40 +08:00 committed by Cameron McCormack
parent 7e3c9e2197
commit ab71b29959
7 changed files with 176 additions and 119 deletions

View file

@ -709,13 +709,13 @@ pub trait MatchMethods : TElement {
}
}
unsafe fn cascade_node(&self,
context: &StyleContext<Self>,
mut data: &mut AtomicRefMut<ElementData>,
parent: Option<Self>,
primary_rule_node: StrongRuleNode,
pseudo_rule_nodes: PseudoRuleNodes,
primary_is_shareable: bool)
fn cascade_node(&self,
context: &StyleContext<Self>,
mut data: &mut AtomicRefMut<ElementData>,
parent: Option<Self>,
primary_rule_node: StrongRuleNode,
pseudo_rule_nodes: PseudoRuleNodes,
primary_is_shareable: bool)
{
// Get our parent's style.
let parent_data = parent.as_ref().map(|x| x.borrow_data().unwrap());
@ -770,10 +770,12 @@ pub trait MatchMethods : TElement {
pseudo_rule_nodes,
&mut possibly_expired_animations);
self.as_node().set_can_be_fragmented(parent.map_or(false, |p| {
p.as_node().can_be_fragmented() ||
parent_style.unwrap().is_multicol()
}));
unsafe {
self.as_node().set_can_be_fragmented(parent.map_or(false, |p| {
p.as_node().can_be_fragmented() ||
parent_style.unwrap().is_multicol()
}));
}
damage
};