Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jan 2005 21:21:08 +0000 (21:21 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 25 Jan 2005 21:21:08 +0000 (21:21 +0000)
commit7cfe0d849e61e43cb78fe2649ff2225d3e550939
tree4e7b4145693bd84abeae9cef08e8f3b2b8de097f
parent6f5e661f921fb4f111736e54880088e6b684a904
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3954710> Mail crashed while editing signatures - NodeImpl::isBlockFlow

        The fix is more general than for this one bug, and may work to fix many crashers. The problem
        is that the ReplaceSelectionCommand never checked whether its starting selection is empty. If
        it is, then we need to bail before doing the work of the command, which we need to deref the
        start and end points of the selection in order to do its work. I think you can see the crash
        potential.

        * khtml/editing/htmlediting.cpp:
        (khtml::ReplaceSelectionCommand::doApply): Assert selection is not empty.
        * kwq/WebCoreBridge.mm:
        (partHasSelection): New helper function to test that bridge has a part with a selection.

        Use new helper function to test part and selection; return from these function if this test fails.

        (-[WebCoreBridge rangeByExpandingSelectionWithGranularity:])
        (-[WebCoreBridge rangeByAlteringCurrentSelection:direction:granularity:])
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:])
        (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:])
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:])
        (-[WebCoreBridge documentFragmentWithText:])
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:])
        (-[WebCoreBridge insertLineBreak])
        (-[WebCoreBridge insertParagraphSeparator])
        (-[WebCoreBridge insertParagraphSeparatorInQuotedContent])
        (-[WebCoreBridge insertText:selectInsertedText:])
        (-[WebCoreBridge deleteSelectionWithSmartDelete:])
        (-[WebCoreBridge ensureSelectionVisible])

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/htmlediting.cpp
WebCore/kwq/WebCoreBridge.mm