Backport crash fix by Huzaifa Sidhpurwala <huzaifas@redhat.com>
authorHuzaifa Sidhpurwala <huzaifas@redhat.com>
Tue, 1 Feb 2011 04:05:47 +0000 (09:35 +0530)
committerHuzaifa Sidhpurwala <huzaifas@redhat.com>
Tue, 1 Feb 2011 04:05:47 +0000 (09:35 +0530)
commitfd077198c300e327ca10e891b265f8efa1436ca0
treeaf04d90ff8479bae7701474c2265e14784377fcd
parentba7b978690468b0c3431f198d190f01a36eb11ca
Backport crash fix by Huzaifa Sidhpurwala <huzaifas@redhat.com>

    2011-01-27  Abhishek Arya  <inferno@chromium.org>

            Reviewed by Dave Hyatt.

            Tests that we do not crash when adding a child in a table
            where the before child is not a table section.
            https://bugs.webkit.org/show_bug.cgi?id=53276

            * fast/table/before-child-non-table-section-add-table-crash-expected.txt: Added.
            * fast/table/before-child-non-table-section-add-table-crash.html: Added.
    2011-01-27  Abhishek Arya  <inferno@chromium.org>

            Reviewed by Dave Hyatt.

            If beforeChild is wrapped in an anonymous table section, we need to
            go the parent to find it and use it before adding childs to table.
            https://bugs.webkit.org/show_bug.cgi?id=53276

            We need to make sure that beforeChild's parent is "this" before calling
            RenderBox::addChild. The previous condition in while is too restrictive
            and fails to calculate the right beforeChild value when its display
            style is table caption.
            Test: fast/table/before-child-non-table-section-add-table-crash.html

            * rendering/RenderTable.cpp:
            (WebCore::RenderTable::addChild):

    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/fast/table/before-child-non-table-section-add-table-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/table/before-child-non-table-section-add-table-crash.html [new file with mode: 0644]
WebCore/rendering/RenderTable.cpp