diff options
author | Martin Robinson <mrobinson@igalia.com> | 2016-10-21 08:03:01 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2016-10-30 21:10:04 +0100 |
commit | 71d285af800c874e5bc9d302d3e45e14de1fb7bb (patch) | |
tree | d20b82fd45b9b8c94009ed046dbbcf19ecab68ea /components/layout/flow.rs | |
parent | fbec79e920c0b0ddeaeeb6c0cc97b20ad85729e0 (diff) | |
download | servo-71d285af800c874e5bc9d302d3e45e14de1fb7bb.tar.gz servo-71d285af800c874e5bc9d302d3e45e14de1fb7bb.zip |
Use a new id type for tracking scrolling areas
This is a step in disassociating scrolling areas from stacking
contexts. Now scroll areas are defined by unique ids, which means that
in the future stacking context will be able to contain more than one.
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r-- | components/layout/flow.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 2c85febaf2c..f68ea3f35fd 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -35,7 +35,7 @@ use flow_list::{FlowList, MutFlowListIterator}; use flow_ref::{self, FlowRef, WeakFlowRef}; use fragment::{Fragment, FragmentBorderBoxIterator, Overflow}; use gfx::display_list::{ClippingRegion, StackingContext}; -use gfx_traits::StackingContextId; +use gfx_traits::{ScrollRootId, StackingContextId}; use gfx_traits::print_tree::PrintTree; use inline::InlineFlow; use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo}; @@ -223,7 +223,9 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static { None } - fn collect_stacking_contexts(&mut self, _parent: &mut StackingContext); + fn collect_stacking_contexts(&mut self, + _parent: &mut StackingContext, + parent_scroll_root_id: ScrollRootId); /// If this is a float, places it. The default implementation does nothing. fn place_float_if_applicable<'a>(&mut self) {} @@ -935,6 +937,8 @@ pub struct BaseFlow { /// to 0, but it assigned during the collect_stacking_contexts phase of display /// list construction. pub stacking_context_id: StackingContextId, + + pub scroll_root_id: ScrollRootId, } impl fmt::Debug for BaseFlow { @@ -1105,6 +1109,7 @@ impl BaseFlow { writing_mode: writing_mode, thread_id: 0, stacking_context_id: StackingContextId::new(0), + scroll_root_id: ScrollRootId::root(), } } @@ -1136,9 +1141,11 @@ impl BaseFlow { return self as *const BaseFlow as usize; } - pub fn collect_stacking_contexts_for_children(&mut self, parent: &mut StackingContext) { + pub fn collect_stacking_contexts_for_children(&mut self, + parent: &mut StackingContext, + parent_scroll_root_id: ScrollRootId) { for kid in self.children.iter_mut() { - kid.collect_stacking_contexts(parent); + kid.collect_stacking_contexts(parent, parent_scroll_root_id); } } |