mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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.
This commit is contained in:
parent
1a3ff8739c
commit
2d72f00ccf
19 changed files with 374 additions and 213 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue