Crash in RenderTable::borderBefore
authorjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 22:16:51 +0000 (22:16 +0000)
committerjchaffraix@webkit.org <jchaffraix@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jan 2012 22:16:51 +0000 (22:16 +0000)
commit4847453caf7e95b9f434837705bff6b399555889
treee5156f3a4ca8b90a0fc871a6f6dc1b5d46388d24
parented2ce11257f70ce8c78450017d93e8b59418684b
Crash in RenderTable::borderBefore
https://bugs.webkit.org/show_bug.cgi?id=75215

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/table/crash-beforeBorder-dirty-section.html

This is a regression from r97661 that added some calls to get the object's borders but tables are a
special case and they may need to recompute some sections' pointers.

The whole sections' pointers lazy recomputation logic is unfortunately far from being bullet proof and
this change is only a mitigation for the current crash.

* rendering/RenderTable.cpp:
(WebCore::RenderTable::borderBefore):
(WebCore::RenderTable::borderAfter):
Make sure we recompute our sections. The change was made here to avoid hitting the
path used inside the table code (ie outerBorder{Before|After}) that shouldn't be
affected.

* rendering/RenderTable.h:
(WebCore::RenderTable::topSection):
Added an ASSERT to catch more bad use in the future.

LayoutTests:

* fast/table/crash-beforeBorder-dirty-section-expected.txt: Added.
* fast/table/crash-beforeBorder-dirty-section.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/table/crash-beforeBorder-dirty-section-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/crash-beforeBorder-dirty-section.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTable.h