mirror of
https://github.com/servo/servo.git
synced 2025-06-23 16:44:33 +01:00
layout: Make box building thread safe by pushing down styles into
non-element children during the cascade. Fetching them from the parent isn't thread-safe. Adds a test for anonymous block box inheritance.
This commit is contained in:
parent
6c2e48f04d
commit
0e20ec02c5
6 changed files with 37 additions and 39 deletions
|
@ -134,16 +134,16 @@ fn match_and_cascade_node(unsafe_layout_node: UnsafeLayoutNode,
|
|||
// Perform the CSS selector matching.
|
||||
let stylist: &Stylist = cast::transmute(layout_context.stylist);
|
||||
node.match_node(stylist);
|
||||
|
||||
// Perform the CSS cascade.
|
||||
let parent_opt = if OpaqueNode::from_layout_node(&node) == layout_context.reflow_root {
|
||||
None
|
||||
} else {
|
||||
node.parent_node()
|
||||
};
|
||||
node.cascade_node(parent_opt);
|
||||
}
|
||||
|
||||
// Perform the CSS cascade.
|
||||
let parent_opt = if OpaqueNode::from_layout_node(&node) == layout_context.reflow_root {
|
||||
None
|
||||
} else {
|
||||
node.parent_node()
|
||||
};
|
||||
node.cascade_node(parent_opt);
|
||||
|
||||
// Enqueue kids.
|
||||
let mut child_count = 0;
|
||||
for kid in node.children() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue