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

@ -35,7 +35,8 @@ use floats::{ClearBoth, ClearLeft, ClearRight, FloatKind, FloatLeft, Floats, Pla
use flow::{BaseFlow, BlockFlowClass, FlowClass, Flow, ImmutableFlowUtils};
use flow::{MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal, mut_base};
use flow;
use fragment::{Fragment, ImageFragment, InlineBlockFragment, ScannedTextFragment};
use fragment::{Fragment, ImageFragment, InlineBlockFragment, FragmentBoundsIterator};
use fragment::ScannedTextFragment;
use incremental::{Reflow, ReflowOutOfFlow};
use layout_debug;
use model::{Auto, IntrinsicISizes, MarginCollapseInfo, MarginsCollapse, MarginsCollapseThrough};
@ -1816,6 +1817,14 @@ impl Flow for BlockFlow {
fn repair_style(&mut self, new_style: &Arc<ComputedValues>) {
self.fragment.repair_style(new_style)
}
fn iterate_through_fragment_bounds(&self, iterator: &mut FragmentBoundsIterator) {
if iterator.should_process(&self.fragment) {
let fragment_origin = self.base.child_fragment_absolute_position(&self.fragment);
iterator.process(&self.fragment,
self.fragment.abs_bounds_from_origin(&fragment_origin));
}
}
}
impl fmt::Show for BlockFlow {