DescriptionDon't use rowIndex() if needsCellRecalc().
The row index may be bogus or even unset in that case.
Rows may be inserted with an initially unknown row index. This happens
when the row isn't inserted at the end of its table section, and also
when splitting an anonymous row. This would lead to an assertion failure
for row()->rowIndexWasSet() in RenderTableCell::styleDidChange().
rowIndex() is used there in a call to
RenderTableSection::rowLogicalHeightChanged(). rowIndex() is also used
in a similar way in RenderTableRow::styleDidChange(), albeit without
asserting first.
styleDidChange() may be called while needsCellRecalc() is set, which
may mean that row index hasn't been calculated yet (or is bogus). We
could of course just recalculate the cells (which also involves
calculating all row indices) in styleDidChange(), but it's not really
necessary, since the row index was just needed in order to call
rowLogicalHeightChanged(), which just bails anyway if cells need recalc.
So the solution is to pass a RenderTableRow instead of the row index to
rowLogicalHeightChanged(). This way we don't call rowIndex() when
row index is unknown.
BUG=397442
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=181637
Patch Set 1 #
Total comments: 2
Patch Set 2 : code review #Patch Set 3 : NULL check in assertion, to avoid crash in unit tests. #
Messages
Total messages: 15 (6 generated)
|