mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
layout: Avoid doing stupid calls to Node::style.
This commit is contained in:
parent
bc29a16285
commit
ecf538ff04
1 changed files with 3 additions and 3 deletions
|
@ -1465,8 +1465,10 @@ impl<'a, ConcreteThreadSafeLayoutNode> PostorderNodeMutTraversal<ConcreteThreadS
|
||||||
fn process(&mut self, node: &ConcreteThreadSafeLayoutNode) {
|
fn process(&mut self, node: &ConcreteThreadSafeLayoutNode) {
|
||||||
node.insert_flags(LayoutDataFlags::HAS_NEWLY_CONSTRUCTED_FLOW);
|
node.insert_flags(LayoutDataFlags::HAS_NEWLY_CONSTRUCTED_FLOW);
|
||||||
|
|
||||||
|
let style = node.style(self.style_context());
|
||||||
|
|
||||||
// Bail out if this node has an ancestor with display: none.
|
// Bail out if this node has an ancestor with display: none.
|
||||||
if node.style(self.style_context()).is_in_display_none_subtree() {
|
if style.is_in_display_none_subtree() {
|
||||||
self.set_flow_construction_result(node, ConstructionResult::None);
|
self.set_flow_construction_result(node, ConstructionResult::None);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1475,11 +1477,9 @@ impl<'a, ConcreteThreadSafeLayoutNode> PostorderNodeMutTraversal<ConcreteThreadS
|
||||||
let (display, float, positioning) = match node.type_id() {
|
let (display, float, positioning) = match node.type_id() {
|
||||||
None => {
|
None => {
|
||||||
// Pseudo-element.
|
// Pseudo-element.
|
||||||
let style = node.style(self.style_context());
|
|
||||||
(style.get_box().display, style.get_box().float, style.get_box().position)
|
(style.get_box().display, style.get_box().float, style.get_box().position)
|
||||||
}
|
}
|
||||||
Some(LayoutNodeType::Element(_)) => {
|
Some(LayoutNodeType::Element(_)) => {
|
||||||
let style = node.style(self.style_context());
|
|
||||||
let original_display = style.get_box().original_display;
|
let original_display = style.get_box().original_display;
|
||||||
let munged_display = match original_display {
|
let munged_display = match original_display {
|
||||||
Display::Inline | Display::InlineBlock => original_display,
|
Display::Inline | Display::InlineBlock => original_display,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue