WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2007 00:53:21 +0000 (00:53 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2007 00:53:21 +0000 (00:53 +0000)
commit08613735a9cc2ad7bcce5f8a57564a2c2fbf7200
tree9c2bd72489b928da6999cf5e3b604b66497a0d86
parente367ad57a2e459ff960c9a663d21a2d989dc5002
WebCore:

        Reviewed by Adele.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16191
          REGRESSION: cannot tab to radio input after setting checked to false

        Test: fast/forms/input-radio-checked-tab.html

        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::CheckedRadioButtons::addButton): Fix this code
        so that it doesn't call setChecked(false) until after the map has been updated.
        Otherwise, we can end up deallocating the map before manipulating it. As long
        as I was changing the function, I decided to make it do only a single hash
        table lookup.

        * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked):
        Remove the button from the radio buttons set before changing the checked
        state. This matches the idiom used elsewhere and fixes the problem where
        setting checked to false would not remove it from the set.

LayoutTests:

        Reviewed by Adele.

        - test for http://bugs.webkit.org/show_bug.cgi?id=16191
          REGRESSION: cannot tab to radio input after setting checked to false

        * fast/forms/input-radio-checked-tab-expected.txt: Added.
        * fast/forms/input-radio-checked-tab.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/input-radio-checked-tab-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/input-radio-checked-tab.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLInputElement.cpp