mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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.
This commit is contained in:
parent
124301cf48
commit
29876d2703
17 changed files with 227 additions and 275 deletions
|
@ -16,10 +16,9 @@ use flow::OpaqueFlow;
|
|||
use flow_ref::FlowRef;
|
||||
use fragment::{CoordinateSystem, Fragment, FragmentBorderBoxIterator, Overflow};
|
||||
use fragment::SpecificFragmentInfo;
|
||||
use gfx::display_list::{OpaqueNode, StackingContext};
|
||||
use gfx::display_list::OpaqueNode;
|
||||
use gfx::font::FontMetrics;
|
||||
use gfx::font_context::FontContext;
|
||||
use gfx_traits::ScrollRootId;
|
||||
use gfx_traits::print_tree::PrintTree;
|
||||
use layout_debug;
|
||||
use model::IntrinsicISizesContribution;
|
||||
|
@ -1622,10 +1621,8 @@ impl Flow for InlineFlow {
|
|||
|
||||
fn update_late_computed_block_position_if_necessary(&mut self, _: Au) {}
|
||||
|
||||
fn collect_stacking_contexts(&mut self,
|
||||
parent: &mut StackingContext,
|
||||
parent_scroll_root_id: ScrollRootId) {
|
||||
self.collect_stacking_contexts_for_inline(parent, parent_scroll_root_id);
|
||||
fn collect_stacking_contexts(&mut self, state: &mut DisplayListBuildState) {
|
||||
self.collect_stacking_contexts_for_inline(state);
|
||||
}
|
||||
|
||||
fn build_display_list(&mut self, state: &mut DisplayListBuildState) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue