layout: Explicitly thread border box dimensions and relative offsets

through display list building.

The old `flow_origin` concept was ill-defined (sometimes the border box
plus the flow origin, sometimes including horizontal margins and
sometimes not, sometimes including relative position and sometimes not),
leading to brittleness and test failures. This commit reworks the logic
to always pass border box origins in during display list building.
This commit is contained in:
Patrick Walton 2014-12-24 21:40:06 -06:00
parent 5ea2c6dcfd
commit bf540d590a
20 changed files with 591 additions and 456 deletions

View file

@ -19,11 +19,11 @@ use context::LayoutContext;
use floats::FloatKind;
use flow::{FlowClass, Flow, ImmutableFlowUtils};
use flow::{IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS};
use fragment::{Fragment, FragmentOverflowIterator};
use fragment::{Fragment, FragmentBorderBoxIterator};
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
use wrapper::ThreadSafeLayoutNode;
use geom::Rect;
use geom::{Point2D, Rect};
use servo_util::geometry::Au;
use std::cmp::{max, min};
use std::fmt;
@ -363,8 +363,10 @@ impl Flow for TableWrapperFlow {
self.block_flow.compute_overflow()
}
fn iterate_through_fragment_overflow(&self, iterator: &mut FragmentOverflowIterator) {
self.block_flow.iterate_through_fragment_overflow(iterator);
fn iterate_through_fragment_border_boxes(&self,
iterator: &mut FragmentBorderBoxIterator,
stacking_context_position: &Point2D<Au>) {
self.block_flow.iterate_through_fragment_border_boxes(iterator, stacking_context_position)
}
}