Add MulticolFlow and use it for multicol elements.

It currently "inherits" from BlockFlow and does not override anything.
This commit is contained in:
Simon Sapin 2015-03-07 17:15:31 +01:00
parent f30cd4f377
commit cc4749373a
6 changed files with 130 additions and 3 deletions

View file

@ -44,6 +44,7 @@ use table_colgroup::TableColGroupFlow;
use table_row::TableRowFlow;
use table_rowgroup::TableRowGroupFlow;
use table_wrapper::TableWrapperFlow;
use multicol::MulticolFlow;
use wrapper::ThreadSafeLayoutNode;
use geom::{Point2D, Rect, Size2D};
@ -158,6 +159,11 @@ pub trait Flow: fmt::Debug + Sync {
panic!("called as_table_cell() on a non-tablecell flow")
}
/// If this is a multicol flow, returns the underlying object. Fails otherwise.
fn as_multicol<'a>(&'a mut self) -> &'a mut MulticolFlow {
panic!("called as_multicol() on a non-multicol flow")
}
/// If this is a table cell flow, returns the underlying object, borrowed immutably. Fails
/// otherwise.
fn as_immutable_table_cell<'a>(&'a self) -> &'a TableCellFlow {
@ -451,6 +457,7 @@ pub enum FlowClass {
TableRow,
TableCaption,
TableCell,
Multicol,
}
/// A top-down traversal.