WebCore:
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 May 2004 22:52:19 +0000 (22:52 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 May 2004 22:52:19 +0000 (22:52 +0000)
commitb0449045b4b75954de908833310240185252d33e
tree676d8fe8a318b4609fff9e14b8ee1c8fa312abc7
parent3e4f196c3c2f1b9be2d0acfaadc7716b3621e7b6
WebCore:

        Reviewed by Hyatt

        Provide the methods to glue the WebView's editing delegate so that these methods work:

        <rdar://problem/3655316>: "Editing:�webViewShouldBeginEditing:inDOMRange:�ethod�nimplemented�WebKit�diting�PI)"
        <rdar://problem/3655317>: "Editing:�webViewShouldEndEditing:inDOMRange:�ethod�nimplemented�WebKit�diting�PI)"

        While I was in the neighborhood and working on understanding focus shifts, I fixed this bug as well:

        <rdar://problem/3645154>: "contentEditable div receives focus and blur twice when focus changes to new element"

        * khtml/khtml_part.cpp:
        (KHTMLPart::invalidateSelection): Do not move focus in this function. That is just a mistake. This function
        is all about redraw.
        (KHTMLPart::selectionLayoutChanged): New function. Factor out the redraw parts of notifySelectionChanged so
        that invalidateSelection can call it.
        (KHTMLPart::notifySelectionChanged): Call selectionLayoutChanged now that the redraw parts have been
        factored out.
        (KHTMLPart::shouldBeginEditing): New function that calls through to the KWQKHTMLPart in an APPLE_CHANGES
        block. This is part of the code path that will eventually The WebView's delegate to ask the
        shouldBeginEditing question.
        (KHTMLPart::shouldEndEditing): Ditto, except the question is about shouldEndEditing.
        * khtml/khtml_part.h:
        * khtml/khtmlview.cpp:
        (KHTMLView::dispatchMouseEvent): Now looks at the boolean value returned from DocumentImpl::setFocusNode
        (described below). If the focus shift was blocked, swallow the mouse event.
        * khtml/xml/dom_docimpl.cpp:
        (DocumentImpl::relinquishesEditingFocus): Part of the WebView's delegation call chain described above.
        (DocumentImpl::acceptsEditingFocus): Ditto.
        (DocumentImpl::setFocusNode): Many improvements. Now handles WebView delegation and switching focus
        in the handlers called as a result of the DOM events that this function calls. Also now returns a
        boolean to say whether the attempt to set focus was blocked by a handler or by the WebView's delegate.
        * khtml/xml/dom_docimpl.h:
        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::shouldBeginEditing): More WebView's delegation glue.
        (KWQKHTMLPart::shouldEndEditing): Ditto.
        * kwq/WebCoreBridge.h:

WebKit:

        Reviewed by Hyatt

        Provide the methods to glue the WebView's editing delegate so that these methods work:

        <rdar://problem/3655316>: "Editing:�webViewShouldBeginEditing:inDOMRange:�ethod�nimplemented�WebKit�diting�PI)"
        <rdar://problem/3655317>: "Editing:�webViewShouldEndEditing:inDOMRange:�ethod�nimplemented�WebKit�diting�PI)"

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge shouldBeginEditing:]): New method used to glue delegate to focus shifts.
        (-[WebBridge shouldEndEditing:]): Ditto.
        * WebView.subproj/WebView.m:
        (-[WebView _shouldBeginEditingInDOMRange:]): Ditto.
        (-[WebView _shouldEndEditingInDOMRange:]): Ditto.
        * WebView.subproj/WebViewPrivate.h: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/khtml/khtml_part.cpp
WebCore/khtml/khtml_part.h
WebCore/khtml/khtmlview.cpp
WebCore/khtml/xml/dom_docimpl.cpp
WebCore/khtml/xml/dom_docimpl.h
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.h
WebKit/ChangeLog
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebView.m
WebKit/WebView.subproj/WebViewPrivate.h