WebCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2007 19:44:20 +0000 (19:44 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2007 19:44:20 +0000 (19:44 +0000)
commitf0415099bbd8c02e924a83120db73d93853a3857
tree29b950abdc5a779c7585e4f348be7d446c78bee7
parente9c0297e5d1a0ae5eb70ca33da3f675d3fcb0867
WebCore:

        Reviewed by Adele.

        - fix <rdar://problem/5608795> CrashTracer: 481 crashes in Safari
          at WebCore::HTMLSelectElement::saveState const + 152

        Test: fast/forms/select-set-inner.html

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::removeChildren): Added a return value, as with other
        calls that change children, so we can optimize for the case where it does nothing.
        (WebCore::ContainerNode::cloneChildNodes): Changed parameter type to ContainerNode.
        * dom/ContainerNode.h: See above.

        * html/HTMLOptGroupElement.cpp:
        (WebCore::HTMLOptGroupElement::removeChildren): Override removeChildren and call
        recalcSelectOptions in that case.
        (WebCore::HTMLOptGroupElement::childrenChanged): Override childrenChanged instead of
        addChild, for consistency with HTMLSelectElement; no need to override both.
        (WebCore::HTMLOptGroupElement::groupLabelText): Made const.
        * html/HTMLOptGroupElement.h: See above.

        * html/HTMLSelectElement.cpp: Don't override addChild any more, because we already
        override childrenChanged, and addChild calls that.
        (WebCore::HTMLSelectElement::removeChildren): Override removeChildren and call
        recalcSelectOptions in that case.
        (WebCore::HTMLSelectElement::recalcListItems): Tightened up the code a little bit
        by using a for loop and traverseNextSibling. Also added some new comments and
        removed some obsolete ones.
        (WebCore::HTMLSelectElement::checkListItems): Added. Debug-only check to make
        sure we don't have a stale list items vector.
        * html/HTMLSelectElement.h: Changed listItems() to invoke checkListItems().
        This will help us catch cases where we have too few calls to setRecalcListItems.

LayoutTests:

        Reviewed by Adele.

        - test for <rdar://problem/5608795> CrashTracer: 481 crashes in Safari
          at WebCore::HTMLSelectElement::saveState const + 152

        * fast/forms/select-set-inner-expected.txt: Added.
        * fast/forms/select-set-inner.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/forms/select-set-inner-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/select-set-inner.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/dom/ContainerNode.cpp
WebCore/dom/ContainerNode.h
WebCore/html/HTMLOptGroupElement.cpp
WebCore/html/HTMLOptGroupElement.h
WebCore/html/HTMLSelectElement.cpp
WebCore/html/HTMLSelectElement.h