diff options
Diffstat (limited to 'components/layout/fragment.rs')
-rw-r--r-- | components/layout/fragment.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index e03de77a6cd..dc09280315a 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -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 { |