Stop using Ref::map for style().

It's not possible to implement a Ref::map equivalent method on AtomicRefCell
while having AtomicRefCell implemented on top of RwArc. We could potentially
reimplement AtomicRefCell to be more like RefCell and add a Ref::map equivalent
method, but I (and pcwalton) think we should try just cloning a few extra
Arcs at these callsites instead.

MozReview-Commit-ID: 6H8vAWguO3z
This commit is contained in:
Bobby Holley 2016-09-29 17:43:04 -07:00
parent 518324cff6
commit 18d552a1e9
5 changed files with 20 additions and 28 deletions

View file

@ -856,7 +856,7 @@ impl Fragment {
/// Constructs a new `Fragment` instance.
pub fn new<N: ThreadSafeLayoutNode>(node: &N, specific: SpecificFragmentInfo, ctx: &LayoutContext) -> Fragment {
let style_context = ctx.style_context();
let style = node.style(style_context).clone();
let style = node.style(style_context);
let writing_mode = style.writing_mode;
let mut restyle_damage = node.restyle_damage();