mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Add get_column_styles for getting column structure and styles for a table
This commit is contained in:
parent
d423e54d58
commit
b416bb3aa7
4 changed files with 57 additions and 7 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue