Add get_column_styles for getting column structure and styles for a table

This commit is contained in:
Manish Goregaokar 2018-02-12 14:58:15 -08:00
parent d423e54d58
commit b416bb3aa7
4 changed files with 57 additions and 7 deletions

View file

@ -1408,6 +1408,16 @@ impl Fragment {
}
}
/// If this is a Column fragment, get the col span
///
/// Panics for non-column fragments
pub fn column_span(&self) -> u32 {
match self.specific {
SpecificFragmentInfo::TableColumn(col_fragment) => max(col_fragment.span, 1),
_ => panic!("non-table-column fragment inside table column?!"),
}
}
/// Returns true if this element can be split. This is true for text fragments, unless
/// `white-space: pre` or `white-space: nowrap` is set.
pub fn can_split(&self) -> bool {