WebCore:
authorjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2007 21:52:41 +0000 (21:52 +0000)
committerjustin.garcia@apple.com <justin.garcia@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 15 Nov 2007 21:52:41 +0000 (21:52 +0000)
commitf9dbd88133e0883a3ffc4acdb5c626fc68d06a4b
treee9d623723b887c259294449db1d483e01387ab11
parentf8237a4bdde0ce17c01a379dccf778a89023e35f
WebCore:

        Reviewed by Adele Peterson.

        <rdar://problem/5497643> Crash at Node::isDescendantOf when switching out of Edit HTML Source mode

        A textarea that contained the selection was removed but the selection wasn't cleared,
        and we'd crash in code that assumed a valid, in-document selection.

        * editing/SelectionController.cpp:
        (WebCore::removingNodeRemovesPosition): Clear the selection if the node being removed is the
        shadowAncestorNode of the node that contains the position, not just if the node being removed
        contains that shadowAncestorNode.

LayoutTests:

        Reviewed by Adele Peterson.

        <rdar://problem/5497643> Crash at Node::isDescendantOf when switching out of Edit HTML Source mode

        * editing/selection/5497643-expected.txt: Added.
        * editing/selection/5497643.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/5497643-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/5497643.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/SelectionController.cpp