RenderTable::sectionAbove() and sectionBelow() skip the last/first child when you ask for the section adjacent to the footer/header. (I ran into this problem while working on another patch and I don't want to include the fix in that patch since it involves updating the results of many Mozilla table tests).
Created attachment 12257 [details] Patch
Comment on attachment 12257 [details] Patch I think resetSectionPointerIfNotBefore needs an assertion that o is a table section as the caption code does that o is a RenderBlock; in fact, I'm not at all sure that there's a guarantee that o is a RenderBlock. Otherwise r=me.
Created attachment 12273 [details] Patch (In reply to comment #2) > (From update of attachment 12257 [details] [edit]) > I think resetSectionPointerIfNotBefore needs an assertion that o is a table > section as the caption code does that o is a RenderBlock; in fact, I'm not at > all sure that there's a guarantee that o is a RenderBlock. The assignments of o (to ptr and to m_caption) where either no-ops or 0 assignments. I changed things to not do the no-op and to make the 0 assignment explicit, so no cast is needed.
Comment on attachment 12273 [details] Patch + m_firstBody = static_cast<RenderTableSection*>(child); Looks like this is indented too far. Looks great to me. r=me, but needs review by Hyatt too.
Created attachment 12304 [details] Patch Fixed indentation.
Comment on attachment 12304 [details] Patch r=me
Landed in r18791.