layout: Implement ordered lists, CSS counters, and quotes per CSS 2.1

§ 12.3-12.5.

Only simple alphabetic and numeric counter styles are supported. (This
is most of them though.)

Although this PR adds a sequential pass to layout, I verified that on
pages that contain a reasonable number of ordered lists (Reddit
`/r/rust`), the time spent in generated content resolution is dwarfed by
the time spent in the parallelizable parts of layout. So I don't expect
this to negatively affect our parallelism expect perhaps in pathological
cases.
This commit is contained in:
Patrick Walton 2015-01-02 17:40:54 -05:00 committed by Simon Sapin
parent 417a932e30
commit 30fd28d107
36 changed files with 1734 additions and 495 deletions

View file

@ -13,13 +13,13 @@
#![deny(unsafe_blocks)]
use block::{BlockFlow, BlockNonReplaced, FloatNonReplaced, ISizeAndMarginsComputer, MarginsMayCollapseFlag};
use construct::FlowConstructor;
use block::{BlockFlow, BlockNonReplaced, FloatNonReplaced, ISizeAndMarginsComputer};
use block::{MarginsMayCollapseFlag};
use context::LayoutContext;
use floats::FloatKind;
use flow::{FlowClass, Flow, ImmutableFlowUtils};
use flow::{IMPACTED_BY_LEFT_FLOATS, IMPACTED_BY_RIGHT_FLOATS};
use fragment::{Fragment, FragmentBorderBoxIterator};
use fragment::{Fragment, FragmentBorderBoxIterator, FragmentMutator};
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
use wrapper::ThreadSafeLayoutNode;
@ -70,23 +70,6 @@ impl TableWrapperFlow {
}
}
pub fn from_node(constructor: &mut FlowConstructor,
node: &ThreadSafeLayoutNode)
-> TableWrapperFlow {
let mut block_flow = BlockFlow::from_node(constructor, node);
let table_layout = if block_flow.fragment().style().get_table().table_layout ==
table_layout::T::fixed {
TableLayout::Fixed
} else {
TableLayout::Auto
};
TableWrapperFlow {
block_flow: block_flow,
column_intrinsic_inline_sizes: vec!(),
table_layout: table_layout
}
}
pub fn float_from_node_and_fragment(node: &ThreadSafeLayoutNode,
fragment: Fragment,
float_kind: FloatKind)
@ -383,6 +366,10 @@ impl Flow for TableWrapperFlow {
stacking_context_position: &Point2D<Au>) {
self.block_flow.iterate_through_fragment_border_boxes(iterator, stacking_context_position)
}
fn mutate_fragments(&mut self, mutator: &mut FragmentMutator) {
self.block_flow.mutate_fragments(mutator)
}
}
impl fmt::Debug for TableWrapperFlow {