WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2007 23:13:36 +0000 (23:13 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Nov 2007 23:13:36 +0000 (23:13 +0000)
commitadd00eadf2c0a1b9d0b7816939253c26cccdf958
tree772ec0fee383962f6fed395317c666818ac6ada7
parent5a5f696a0ff723dd8adb34df44d806f917922556
WebCore:

        Reviewed by Mitz.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15806
          <rdar://problem/5561626> ASSERT(element->isRadioButton()) fires destroying form elements

        Test: fast/forms/remove-radio-button-assert.html

        * html/HTMLGenericFormElement.cpp: (WebCore::HTMLGenericFormElement::removeFromForm):
        Added protected function to be used by derived classes that need to do the same sort
        of removal from form that's automatically done by the base class in certain circumstances.
        * html/HTMLGenericFormElement.h: Added removeFromForm.

        * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::~HTMLInputElement):
        Call removeFromForm here so the element is removed before we destroy the HTMLInputElement
        part of this object. By the time we get to the base class's destructor it's too late.
        The problem is specific to radio buttons so we don't have to worry about other classes
        derived from HTMLGenericFormElement.

LayoutTests:

        Reviewed by Mitz.

        - test for http://bugs.webkit.org/show_bug.cgi?id=15806
          <rdar://problem/5561626> ASSERT(element->isRadioButton()) fires destroying form elements

        * fast/forms/remove-radio-button-assert-expected.txt: Added.
        * fast/forms/remove-radio-button-assert.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/remove-radio-button-assert-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/remove-radio-button-assert.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLGenericFormElement.cpp
WebCore/html/HTMLGenericFormElement.h
WebCore/html/HTMLInputElement.cpp