Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Issue 532513002: Don't use rowIndex() if needsCellRecalc(). (Closed)

Created:
6 years, 3 months ago by mstensho (USE GERRIT)
Modified:
6 years, 3 months ago
CC:
blink-reviews, blink-reviews-rendering, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr., rune+blink, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Don'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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -5 lines) Patch
A LayoutTests/fast/table/split-anonymous-crash.html View 1 1 chunk +18 lines, -0 lines 0 comments Download
A LayoutTests/fast/table/split-anonymous-crash-expected.txt View 1 1 chunk +5 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderTableCell.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/rendering/RenderTableRow.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/rendering/RenderTableRow.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableSection.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTableSection.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 15 (6 generated)
mstensho (USE GERRIT)
6 years, 3 months ago (2014-09-01 14:14:58 UTC) #2
Julien - ping for review
lgtm https://codereview.chromium.org/532513002/diff/1/LayoutTests/fast/table/split-anonymous-crash.html File LayoutTests/fast/table/split-anonymous-crash.html (right): https://codereview.chromium.org/532513002/diff/1/LayoutTests/fast/table/split-anonymous-crash.html#newcode13 LayoutTests/fast/table/split-anonymous-crash.html:13: <p>This should not crash.</p> Nit: Let's add a ...
6 years, 3 months ago (2014-09-08 23:03:35 UTC) #3
mstensho (USE GERRIT)
https://codereview.chromium.org/532513002/diff/1/LayoutTests/fast/table/split-anonymous-crash.html File LayoutTests/fast/table/split-anonymous-crash.html (right): https://codereview.chromium.org/532513002/diff/1/LayoutTests/fast/table/split-anonymous-crash.html#newcode13 LayoutTests/fast/table/split-anonymous-crash.html:13: <p>This should not crash.</p> On 2014/09/08 23:03:35, Julien Chaffraix ...
6 years, 3 months ago (2014-09-09 07:20:02 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mstensho@opera.com/532513002/20001
6 years, 3 months ago (2014-09-09 07:20:40 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/22659)
6 years, 3 months ago (2014-09-09 07:37:28 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mstensho@opera.com/532513002/40001
6 years, 3 months ago (2014-09-09 08:10:08 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/26177)
6 years, 3 months ago (2014-09-09 10:37:47 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mstensho@opera.com/532513002/40001
6 years, 3 months ago (2014-09-09 10:57:12 UTC) #14
commit-bot: I haz the power
6 years, 3 months ago (2014-09-09 11:37:01 UTC) #15
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as 181637

Powered by Google App Engine
This is Rietveld 408576698