From f796823b944e2434a14458283c980eeb3422ba8d Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 14 Feb 2018 17:17:34 -0800 Subject: [PATCH] Handle rowspan --- components/layout/table.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/layout/table.rs b/components/layout/table.rs index 36aa1d10cb8..269267010a6 100644 --- a/components/layout/table.rs +++ b/components/layout/table.rs @@ -1089,6 +1089,16 @@ impl<'table> Iterator for TableCellStyleIterator<'table> { // FIXME We do this awkward .take() followed by shoving it back in // because without NLL the row_info borrow lasts too long if let Some(mut row_info) = self.row_info.take() { + if let Some(rowspan) = row_info.row.incoming_rowspan.get(self.column_index.absolute as usize) { + // we are not allowed to use this column as a starting point. Try the next one. + if *rowspan > 1 { + self.column_index.advance(1, &self.column_styles); + // put row_info back in + self.row_info = Some(row_info); + // try again + return self.next(); + } + } if let Some(cell) = row_info.cell_iterator.next() { let rowgroup_style = row_info.rowgroup.map(|r| r.style()); let row_style = row_info.row.block_flow.fragment.style();