mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Simplify stacking context collection
Simplify the way that stacking contexts are collected. Instead of passing the StackingContextId down the tree, pass the parent StackingContext itself. This will allow future patches to get more information about the parent stacking context (such as location). Also remove the return value of collect_stacking_contexts, which was unused.
This commit is contained in:
parent
ef1b594f48
commit
066775915c
16 changed files with 88 additions and 184 deletions
|
@ -224,10 +224,7 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
|||
None
|
||||
}
|
||||
|
||||
fn collect_stacking_contexts(&mut self,
|
||||
_parent_id: StackingContextId,
|
||||
_: &mut Vec<Box<StackingContext>>)
|
||||
-> StackingContextId;
|
||||
fn collect_stacking_contexts(&mut self, _parent: &mut StackingContext);
|
||||
|
||||
/// If this is a float, places it. The default implementation does nothing.
|
||||
fn place_float_if_applicable<'a>(&mut self) {}
|
||||
|
@ -1160,11 +1157,9 @@ impl BaseFlow {
|
|||
return self as *const BaseFlow as usize;
|
||||
}
|
||||
|
||||
pub fn collect_stacking_contexts_for_children(&mut self,
|
||||
parent_id: StackingContextId,
|
||||
contexts: &mut Vec<Box<StackingContext>>) {
|
||||
pub fn collect_stacking_contexts_for_children(&mut self, parent: &mut StackingContext) {
|
||||
for kid in self.children.iter_mut() {
|
||||
kid.collect_stacking_contexts(parent_id, contexts);
|
||||
kid.collect_stacking_contexts(parent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue