mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Merge pull request #3420 from glennw/table-debug
Adds support for table layout trace and updates viewer for tables.
This commit is contained in:
commit
ccda8f204a
9 changed files with 118 additions and 10 deletions
|
@ -103,11 +103,22 @@ pub trait Flow: fmt::Show + ToString + Share {
|
|||
fail!("called as_table_wrapper() on a non-tablewrapper flow")
|
||||
}
|
||||
|
||||
/// If this is a table wrapper flow, returns the underlying object, borrowed immutably. Fails
|
||||
/// otherwise.
|
||||
fn as_immutable_table_wrapper<'a>(&'a self) -> &'a TableWrapperFlow {
|
||||
fail!("called as_immutable_table_wrapper() on a non-tablewrapper flow")
|
||||
}
|
||||
|
||||
/// If this is a table flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table<'a>(&'a mut self) -> &'a mut TableFlow {
|
||||
fail!("called as_table() on a non-table flow")
|
||||
}
|
||||
|
||||
/// If this is a table flow, returns the underlying object, borrowed immutably. Fails otherwise.
|
||||
fn as_immutable_table<'a>(&'a self) -> &'a TableFlow {
|
||||
fail!("called as_table() on a non-table flow")
|
||||
}
|
||||
|
||||
/// If this is a table colgroup flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table_colgroup<'a>(&'a mut self) -> &'a mut TableColGroupFlow {
|
||||
fail!("called as_table_colgroup() on a non-tablecolgroup flow")
|
||||
|
@ -118,11 +129,23 @@ pub trait Flow: fmt::Show + ToString + Share {
|
|||
fail!("called as_table_rowgroup() on a non-tablerowgroup flow")
|
||||
}
|
||||
|
||||
/// If this is a table rowgroup flow, returns the underlying object, borrowed immutably. Fails
|
||||
/// otherwise.
|
||||
fn as_immutable_table_rowgroup<'a>(&'a self) -> &'a TableRowGroupFlow {
|
||||
fail!("called as_table_rowgroup() on a non-tablerowgroup flow")
|
||||
}
|
||||
|
||||
/// If this is a table row flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table_row<'a>(&'a mut self) -> &'a mut TableRowFlow {
|
||||
fail!("called as_table_row() on a non-tablerow flow")
|
||||
}
|
||||
|
||||
/// If this is a table row flow, returns the underlying object, borrowed immutably. Fails
|
||||
/// otherwise.
|
||||
fn as_immutable_table_row<'a>(&'a self) -> &'a TableRowFlow {
|
||||
fail!("called as_table_row() on a non-tablerow flow")
|
||||
}
|
||||
|
||||
/// If this is a table cell flow, returns the underlying object. Fails otherwise.
|
||||
fn as_table_caption<'a>(&'a mut self) -> &'a mut TableCaptionFlow {
|
||||
fail!("called as_table_caption() on a non-tablecaption flow")
|
||||
|
@ -133,6 +156,12 @@ pub trait Flow: fmt::Show + ToString + Share {
|
|||
fail!("called as_table_cell() on a non-tablecell 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 {
|
||||
fail!("called as_table_cell() on a non-tablecell flow")
|
||||
}
|
||||
|
||||
/// If this is a table row or table rowgroup or table flow, returns column inline-sizes.
|
||||
/// Fails otherwise.
|
||||
fn col_inline_sizes<'a>(&'a mut self) -> &'a mut Vec<Au> {
|
||||
|
@ -289,7 +318,12 @@ impl<'a, E, S: Encoder<E>> Encodable<S, E> for &'a Flow {
|
|||
match self.class() {
|
||||
BlockFlowClass => self.as_immutable_block().encode(e),
|
||||
InlineFlowClass => self.as_immutable_inline().encode(e),
|
||||
_ => { Ok(()) } // TODO: Support tables
|
||||
TableFlowClass => self.as_immutable_table().encode(e),
|
||||
TableWrapperFlowClass => self.as_immutable_table_wrapper().encode(e),
|
||||
TableRowGroupFlowClass => self.as_immutable_table_rowgroup().encode(e),
|
||||
TableRowFlowClass => self.as_immutable_table_row().encode(e),
|
||||
TableCellFlowClass => self.as_immutable_table_cell().encode(e),
|
||||
_ => { Ok(()) } // TODO: Support captions
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue