diff options
author | Martin Robinson <mrobinson@igalia.com> | 2014-10-29 19:02:31 -0700 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2014-11-03 10:30:28 -0800 |
commit | 2d72f00ccf8abfd5805dccdca5a635fa4e8e0cb8 (patch) | |
tree | b49ad076db1f72b40102aaaa99683775749d883f /components/layout/flow.rs | |
parent | 1a3ff8739c2a17d61f295f213f31ddee25e0b3ae (diff) | |
download | servo-2d72f00ccf8abfd5805dccdca5a635fa4e8e0cb8.tar.gz servo-2d72f00ccf8abfd5805dccdca5a635fa4e8e0cb8.zip |
Have ContentBox(es)Queries consult the flow tree
Instead of looking at the display tree, have ContentBox(es)Query consult
the flow tree. This allow optimizing away parts of the display tree
later. To do this we need to be more careful about how we send reflow
requests, only querying the flow tree when possible.
Fixes #3790.
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r-- | components/layout/flow.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs index 2479dc14c9d..91a16966557 100644 --- a/components/layout/flow.rs +++ b/components/layout/flow.rs @@ -31,7 +31,7 @@ use context::LayoutContext; use floats::Floats; use flow_list::{FlowList, FlowListIterator, MutFlowListIterator}; use flow_ref::FlowRef; -use fragment::{Fragment, TableRowFragment, TableCellFragment}; +use fragment::{Fragment, FragmentBoundsIterator, TableRowFragment, TableCellFragment}; use incremental::{ReconstructFlow, Reflow, ReflowOutOfFlow, RestyleDamage}; use inline::InlineFlow; use model::{CollapsibleMargins, IntrinsicISizes, MarginCollapseInfo}; @@ -214,6 +214,9 @@ pub trait Flow: fmt::Show + ToString + Sync { /// Phase 5 of reflow: builds display lists. fn build_display_list(&mut self, layout_context: &LayoutContext); + /// Perform an iteration of fragment bounds on this flow. + fn iterate_through_fragment_bounds(&self, iterator: &mut FragmentBoundsIterator); + fn compute_collapsible_block_start_margin(&mut self, _layout_context: &mut LayoutContext, _margin_collapse_info: &mut MarginCollapseInfo) { @@ -943,6 +946,14 @@ impl BaseFlow { } } } + + pub fn child_fragment_absolute_position(&self, fragment: &Fragment) -> Point2D<Au> { + let relative_offset = + fragment.relative_position(&self + .absolute_position_info + .relative_containing_block_size); + self.abs_position.add_size(&relative_offset.to_physical(self.writing_mode)) + } } impl<'a> ImmutableFlowUtils for &'a Flow + 'a { |