aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/sequential.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2016-03-17 14:28:37 -0700
committerPatrick Walton <pcwalton@mimiga.net>2016-03-18 22:11:51 -0700
commit5ea8c342768c9898da82c9b8989a3f8f5dc649d5 (patch)
tree0a9e12d4b4ae6f6afd6fa3b3041b5754568dfddb /components/layout/sequential.rs
parent2d6283c64be8c052e6b0a06e857950d7f25db353 (diff)
downloadservo-5ea8c342768c9898da82c9b8989a3f8f5dc649d5.tar.gz
servo-5ea8c342768c9898da82c9b8989a3f8f5dc649d5.zip
layout: Move overflow calculation to be a separate, sequential,
bottom-up pass. Right now, the only reason that overflow calculation works is that we rely on script inducing extra reflows that are sent for display. This was preventing #10021 from landing. This change regresses layout performance by about 1% in my tests. Fixes #7797 properly.
Diffstat (limited to 'components/layout/sequential.rs')
-rw-r--r--components/layout/sequential.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs
index a10637b75fb..dbf469db082 100644
--- a/components/layout/sequential.rs
+++ b/components/layout/sequential.rs
@@ -14,6 +14,7 @@ use flow_ref::{self, FlowRef};
use fragment::FragmentBorderBoxIterator;
use generated_content::ResolveGeneratedContent;
use gfx::display_list::{DisplayListEntry, StackingContext};
+use incremental::STORE_OVERFLOW;
use style::dom::TNode;
use style::traversal::DomTraversalContext;
use traversal::{AssignBSizes, AssignISizes};
@@ -117,3 +118,18 @@ pub fn iterate_through_flow_tree_fragment_border_boxes(root: &mut FlowRef,
doit(flow_ref::deref_mut(root), 0, iterator, &Point2D::zero());
}
+
+pub fn store_overflow(layout_context: &LayoutContext, flow: &mut Flow) {
+ if !flow::base(flow).restyle_damage.contains(STORE_OVERFLOW) {
+ return
+ }
+
+ for mut kid in flow::mut_base(flow).child_iter() {
+ store_overflow(layout_context, kid);
+ }
+
+ flow.store_overflow(layout_context);
+
+ flow::mut_base(flow).restyle_damage.remove(STORE_OVERFLOW);
+}
+