diff options
author | Martin Robinson <mrobinson@igalia.com> | 2016-12-06 14:07:08 -1000 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2017-01-10 13:33:08 +0100 |
commit | 29876d2703336fc74a3857854839badc1bb58ceb (patch) | |
tree | cffa60cd00c82b3a662ae81490440d2e14054e8b /components/layout/sequential.rs | |
parent | 124301cf484818a87ab0b3e0c4ef34645be66174 (diff) | |
download | servo-29876d2703336fc74a3857854839badc1bb58ceb.tar.gz servo-29876d2703336fc74a3857854839badc1bb58ceb.zip |
Rework the way scroll roots are collected
Collect scroll roots during the collect_stacking_context phase instead
of during display list construction. This will be useful in order to
collect containing block scroll roots as well as to give scroll roots
sequential ids in the future. This change also pulls stacking context
children out of the StackingContext struct itself, which should reduce
very slightly the memory used by the finished display list. This also
simplifies the DisplayListBuilder because it no longer has to maintain
a stack of ScrollRootIds and StackingContextIds and can instead just
rely on the program stack.
Diffstat (limited to 'components/layout/sequential.rs')
-rw-r--r-- | components/layout/sequential.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index b8c62aaafb0..6dd0f8c440b 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -14,7 +14,6 @@ use flow::{PostorderFlowTraversal, PreorderFlowTraversal}; use flow::IS_ABSOLUTELY_POSITIONED; use fragment::FragmentBorderBoxIterator; use generated_content::ResolveGeneratedContent; -use gfx_traits::ScrollRootId; use servo_config::opts; use style::servo::restyle_damage::{REFLOW, STORE_OVERFLOW}; use traversal::{AssignBSizes, AssignISizes, BubbleISizes, BuildDisplayList}; @@ -76,9 +75,8 @@ pub fn traverse_flow_tree_preorder(root: &mut Flow, pub fn build_display_list_for_subtree<'a>(flow_root: &mut Flow, shared_layout_context: &'a SharedLayoutContext) -> DisplayListBuildState<'a> { - let mut state = DisplayListBuildState::new(shared_layout_context, - flow::base(flow_root).stacking_context_id); - flow_root.collect_stacking_contexts(&mut state.root_stacking_context, ScrollRootId::root()); + let mut state = DisplayListBuildState::new(shared_layout_context); + flow_root.collect_stacking_contexts(&mut state); let mut build_display_list = BuildDisplayList { state: state }; build_display_list.traverse(flow_root); |