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:
Martin Robinson 2014-10-29 19:02:31 -07:00
parent 1a3ff8739c
commit 2d72f00ccf
19 changed files with 374 additions and 213 deletions

View file

@ -322,7 +322,7 @@ impl FragmentDisplayListBuilding for Fragment {
Rect(physical_rect.origin + flow_origin, physical_rect.size)
};
// Fragment position wrt to the owning flow.
let absolute_fragment_bounds = rect_to_absolute(self.style.writing_mode, self.border_box);
let absolute_fragment_bounds = self.abs_bounds_from_origin(&flow_origin);
debug!("Fragment::build_display_list at rel={}, abs={}: {}",
self.border_box,
absolute_fragment_bounds,
@ -615,18 +615,12 @@ impl BlockFlowDisplayListBuilding for BlockFlow {
fn build_display_list_for_block(&mut self,
layout_context: &LayoutContext,
background_border_level: BackgroundAndBorderLevel) {
let relative_offset =
self.fragment.relative_position(&self.base
.absolute_position_info
.relative_containing_block_size);
// Add the box that starts the block context.
self.base.display_list = DisplayList::new();
let absolute_position =
self.base.abs_position.add_size(&relative_offset.to_physical(self.base.writing_mode));
let absolute_fragment_origin = self.base.child_fragment_absolute_position(&self.fragment);
self.fragment.build_display_list(&mut self.base.display_list,
layout_context,
absolute_position,
absolute_fragment_origin,
background_border_level,
&self.base.clip_rect);