diff options
author | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-20 12:49:39 -0700 |
---|---|---|
committer | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-22 17:46:28 -0700 |
commit | 5cd47c76700c10b7ee7b1454d941190f70ec1aab (patch) | |
tree | 9144c3c347e2530ffccd8dafd11517131168aa8c /components/layout/traversal.rs | |
parent | a6f0159cb85e3b84a826c41ae5ad1b6aea09d7cc (diff) | |
download | servo-5cd47c76700c10b7ee7b1454d941190f70ec1aab.tar.gz servo-5cd47c76700c10b7ee7b1454d941190f70ec1aab.zip |
Clear reflow flags after reflow.
Diffstat (limited to 'components/layout/traversal.rs')
-rw-r--r-- | components/layout/traversal.rs | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs index 5e071651c63..e1b02266134 100644 --- a/components/layout/traversal.rs +++ b/components/layout/traversal.rs @@ -8,7 +8,8 @@ use css::node_style::StyledNode; use css::matching::{ApplicableDeclarations, CannotShare, MatchMethods, StyleWasShared}; use construct::FlowConstructor; use context::LayoutContext; -use flow::{Flow, MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal}; +use flow::{Flow, ImmutableFlowUtils, MutableFlowUtils}; +use flow::{PreorderFlowTraversal, PostorderFlowTraversal}; use flow; use incremental::{RestyleDamage, BubbleISizes, Reflow}; use wrapper::{layout_node_to_unsafe_layout_node, LayoutNode}; @@ -282,6 +283,7 @@ impl<'a> PostorderFlowTraversal for BubbleISizes<'a> { #[inline] fn process(&self, flow: &mut Flow) { flow.bubble_inline_sizes(); + flow::mut_base(flow).restyle_damage.remove(BubbleISizes); } #[inline] @@ -298,12 +300,18 @@ pub struct AssignISizes<'a> { impl<'a> PreorderFlowTraversal for AssignISizes<'a> { #[inline] fn process(&self, flow: &mut Flow) { - flow.assign_inline_sizes(self.layout_context); + if flow::base(flow).restyle_damage.contains(Reflow) { + flow.assign_inline_sizes(self.layout_context); + } else if flow.is_block_like() { + let block = flow.as_block(); + block.propagate_and_compute_used_inline_size(self.layout_context); + } } #[inline] fn should_process(&self, flow: &mut Flow) -> bool { - flow::base(flow).restyle_damage.contains(Reflow) + // TODO(cgaebel): Incremental inline size assignment. + flow::base(flow).restyle_damage.contains(Reflow) || true } } @@ -318,18 +326,26 @@ pub struct AssignBSizesAndStoreOverflow<'a> { impl<'a> PostorderFlowTraversal for AssignBSizesAndStoreOverflow<'a> { #[inline] fn process(&self, flow: &mut Flow) { - flow.assign_block_size(self.layout_context); - // Skip store-overflow for absolutely positioned flows. That will be - // done in a separate traversal. - if !flow.is_store_overflow_delayed() { - flow.store_overflow(self.layout_context); + if !flow::base(flow).flags.impacted_by_floats() { + flow.assign_block_size(self.layout_context); + + // Skip store-overflow for absolutely positioned flows. That will be + // done in a separate traversal. + + if flow::base(flow).restyle_damage.contains(Reflow) { + if !flow.is_store_overflow_delayed() { + flow.store_overflow(self.layout_context); + } + } } + + flow::mut_base(flow).restyle_damage.remove(Reflow); } #[inline] fn should_process(&self, flow: &mut Flow) -> bool { - let base = flow::base(flow); - base.restyle_damage.contains(Reflow) && !base.flags.impacted_by_floats() + // TODO(cgaebel): Incremental block size assignment. + flow::base(flow).restyle_damage.contains(Reflow) || true } } @@ -340,7 +356,7 @@ pub struct ComputeAbsolutePositions<'a> { impl<'a> PreorderFlowTraversal for ComputeAbsolutePositions<'a> { #[inline] fn process(&self, flow: &mut Flow) { - flow.compute_absolute_position() + flow.compute_absolute_position(); } } @@ -351,6 +367,6 @@ pub struct BuildDisplayList<'a> { impl<'a> PostorderFlowTraversal for BuildDisplayList<'a> { #[inline] fn process(&self, flow: &mut Flow) { - flow.build_display_list(self.layout_context) + flow.build_display_list(self.layout_context); } } |