mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
layout: Make the stacking context take into account the children transform when calculating overflow areas.
This only works for simple translations and similar, but I want Patrick to validate my approach.
This commit is contained in:
parent
49431be44a
commit
fd3a99ead3
5 changed files with 85 additions and 32 deletions
|
@ -1729,7 +1729,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
|||
}
|
||||
}
|
||||
|
||||
contexts[stacking_context_index].children = floating;
|
||||
contexts[stacking_context_index].set_children(floating);
|
||||
return stacking_context_id;
|
||||
}
|
||||
|
||||
|
@ -1745,14 +1745,14 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
|||
&self.base,
|
||||
scroll_policy,
|
||||
StackingContextCreationMode::InnerScrollWrapper);
|
||||
inner_stacking_context.children = child_contexts;
|
||||
inner_stacking_context.set_children(child_contexts);
|
||||
|
||||
let mut outer_stacking_context = self.fragment.create_stacking_context(
|
||||
stacking_context_id,
|
||||
&self.base,
|
||||
scroll_policy,
|
||||
StackingContextCreationMode::OuterScrollWrapper);
|
||||
outer_stacking_context.children.push(inner_stacking_context);
|
||||
outer_stacking_context.add_child(inner_stacking_context);
|
||||
outer_stacking_context
|
||||
} else {
|
||||
let mut stacking_context = self.fragment.create_stacking_context(
|
||||
|
@ -1760,7 +1760,7 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
|
|||
&self.base,
|
||||
scroll_policy,
|
||||
StackingContextCreationMode::Normal);
|
||||
stacking_context.children = child_contexts;
|
||||
stacking_context.set_children(child_contexts);
|
||||
stacking_context
|
||||
};
|
||||
|
||||
|
|
|
@ -84,8 +84,10 @@ pub fn build_display_list_for_subtree(root: &mut FlowRef,
|
|||
let flow_root = flow_ref::deref_mut(root);
|
||||
let layout_context = LayoutContext::new(shared_layout_context);
|
||||
flow_root.traverse_preorder(&ComputeAbsolutePositions { layout_context: &layout_context });
|
||||
let mut children = vec![];
|
||||
flow_root.collect_stacking_contexts(root_stacking_context.id,
|
||||
&mut root_stacking_context.children);
|
||||
&mut children);
|
||||
root_stacking_context.add_children(children);
|
||||
let mut build_display_list = BuildDisplayList {
|
||||
state: DisplayListBuildState::new(&layout_context,
|
||||
flow::base(&*flow_root).stacking_context_id),
|
||||
|
|
|
@ -260,7 +260,7 @@ impl WebRenderStackingContextConverter for StackingContext {
|
|||
builder: &mut webrender_traits::DisplayListBuilder,
|
||||
frame_builder: &mut WebRenderFrameBuilder,
|
||||
_force_positioned_stacking_level: bool) {
|
||||
for child in self.children.iter() {
|
||||
for child in self.children() {
|
||||
while let Some(item) = traversal.advance(self) {
|
||||
item.convert_to_webrender(builder, frame_builder);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue