WebCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Sep 2004 18:54:11 +0000 (18:54 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Sep 2004 18:54:11 +0000 (18:54 +0000)
commitafa5cda10634c57bc6e228175e55f7be129b4fda
tree79e98e25f269ac1356c74642fa622b50c10c2cc8
parent66e19fcac747465208d327e18975bb50d63dc406
WebCore:

        Reviewed by Ken.

        - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions)
        - fixed <rdar://problem/3735055> REGRESSION (Mail): WebCore double click rules treat style change as a boundary
        - fixed <rdar://problem/3789939> REGRESSION (Mail): double-clicking on border whitespace selects space plus word before/after
        - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word
        - fixed <rdar://problem/3806604> REGRESSION (164): Triple-click sometimes selects extra characters
        - fixed <rdar://problem/3806996> REGRESSION (125-162): Triple-click in <pre> tagged text behaves oddly (leuf.net)

        * khtml/xml/dom_caretposition.h: Added a lot of new functions. Removed implicit conversion operator
        that converts from CaretPosition to Position.
        * khtml/xml/dom_caretposition.cpp:
        (DOM::CaretPosition::CaretPosition): Change to call deepEquivalent so it works without the implicit
        Position conversion operator.
        (DOM::CaretPosition::operator=): Ditto.
        (DOM::CaretPosition::next): Ditto.
        (DOM::CaretPosition::previous): Ditto.
        (DOM::CaretPosition::setPosition): Added an assertion.
        (DOM::start): Added.
        (DOM::end): Added.
        (DOM::setStart): Added.
        (DOM::setEnd): Added.
        (DOM::previousWordBoundary): Added.
        (DOM::nextWordBoundary): Added.
        (DOM::startWordBoundary): Added.
        (DOM::startOfWord): Added.
        (DOM::endWordBoundary): Added.
        (DOM::endOfWord): Added.
        (DOM::previousWordPositionBoundary): Added.
        (DOM::previousWordPosition): Added.
        (DOM::nextWordPositionBoundary): Added.
        (DOM::nextWordPosition): Added.
        (DOM::previousLinePosition): Added.
        (DOM::nextLinePosition): Added.
        (DOM::startOfParagraph): Changed function name.
        (DOM::endOfParagraph): Changed function name. Fixed code in includeLineBreak to work around
        the CaretPosition constructor issue for <br>, pass the right parameter for the block flow case,
        and handle <pre> properly.
        (DOM::inSameParagraph): Added.
        (DOM::previousParagraphPosition): Added.
        (DOM::nextParagraphPosition): Added.

        * khtml/xml/dom_position.h: Removed a number of functions no longer used; also made some private.
        * khtml/xml/dom_position.cpp: Removed a number of functions no longer used.

        * khtml/xml/dom_selection.h: Replaced DOCUMENT with DOCUMENT_BOUNDARY. Added overloads of lots
        of functions that take CaretPosition directly. Added overload of modify that takes a parameter
        for vertical distance to help implement pageDown: and friends. Replaced getRepaintRect with
        two new functions named caretRect and caretRepaintRect. Removed nodeIsBeforeNode.
        * khtml/xml/dom_selection.cpp:
        (DOM::Selection::Selection): Added constructor that takes two CaretPosition objects.
        (DOM::Selection::setModifyBias): Added. Helper function.
        (DOM::Selection::modifyExtendingRightForward): Don't set modify bias, since that's now the caller's
        responsibility. Reimplement WORD and LINE in terms of new CaretPosition functions. Implement PARAGRAPH
        and change PARAGRAPH_BOUNDARY to use CaretPosition function by its new name.
        (DOM::Selection::modifyMovingRightForward): Ditto.
        (DOM::Selection::modifyExtendingLeftBackward): Ditto.
        (DOM::Selection::modifyMovingLeftBackward): Ditto.
        (DOM::Selection::modify): Call setModifyBias, and use a switch statement instead of if.
        (DOM::caretY): Added. Helper for the new modify function that implements moving a pixel distance,
        used by pageDown: and friends.
        (DOM::Selection::modify): Added.
        (DOM::Selection::toRange): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
        (DOM::Selection::caretRect): Added. Replaces getRepaintRect, but does not add slop.
        (DOM::Selection::caretRepaintRect): Added. Replaces getRepaintRect; still adds slop.
        (DOM::Selection::needsCaretRepaint): Call caretRepaintRect.
        (DOM::Selection::validate): Use RangeImpl::compareBoundaryPoints instead of nodeIsBeforeNode.
        Reimplement WORD to use new CaretPosition functions; this fixes the double-clicking problems.
        Change paragraph calls to use new names.

        * ForwardingHeaders/dom/dom_position.h: Removed. This was in the wrong location.
        * khtml/editing/htmlediting.cpp: Fixed include that said "dom/dom_position.h".
        * khtml/editing/htmlediting_impl.cpp: Fixed include that said "dom/dom_position.h".
        (khtml::TypingCommandImpl::markMisspellingsAfterTyping): Rewrote this to use the new CaretPosition
        functions instead of the old Position functions.

        * khtml/misc/helper.h: Added const to character pointer parameter. Also put invertedColor inside
        an !APPLE_CHANGES since it doesn't do us any good.
        * khtml/misc/helper.cpp:
        (khtml::findWordBoundary): Added const to character pointer parameter.
        (khtml::nextWordFromIndex): Ditto.

        * kwq/KWQTextUtilities.h: Change parameters to const.
        * kwq/KWQTextUtilities.cpp: (KWQFindWordBoundary): Change parameter to const.
        * kwq/KWQTextUtilities.mm: (KWQFindNextWordFromIndex): Change parameter to const.

        * khtml/css/cssstyleselector.cpp: Disable code that uses invertedColor when APPLE_CHANGES, since it
        won't work for us.

        * khtml/rendering/render_canvas.cpp: (RenderCanvas::setSelection): Added checks for selection end
        so we can set the selection end to nodes that are not leaf nodes and it will still work. Also took
        out bogus firstChild/lastChild loops for the same reason.

        * kwq/KWQKHTMLPart.h: Add "start before selection" flag to advanceToNextMisspelling.
        Needed to fix bug with spell checking.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::findString): Changed to use CaretPosition.
        (KWQKHTMLPart::advanceToNextMisspelling): Added code to handle "start before selection" flag
        and changed to use CaretPosition and new helper functions.
        (KWQKHTMLPart::markMisspellingsInSelection): More changes to use CaretPosition.
        (KWQKHTMLPart::updateSpellChecking): Ditto.

        * kwq/WebCoreBridge.h: Replaced WebSelectByDocument with WebSelectToDocumentBoundary.
        Added advanceToNextMisspellingStartingJustBeforeSelection,
        rangeByAlteringCurrentSelection:verticalDistance:, and
        alterCurrentSelection:verticalDistance:.

        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge advanceToNextMisspellingStartingJustBeforeSelection]): Added.
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): Added case for selecting by
        paragraph to save X position.
        (-[WebCoreBridge rangeByAlteringCurrentSelection:verticalDistance:]): Added.
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Added.
        (-[WebCoreBridge ensureCaretVisible]): Call caretRect instead of getRepaintRect.

WebKit:

        Reviewed by Ken.

        - fixed <rdar://problem/3655360> REGRESSION (Mail): Ctrl-V emacs key binding, -pageDown: method, unimplemented (and pageUp, and selection-modifying versions)
        - fixed <rdar://problem/3792138> REGRESSION (Mail): Spell checker doesn't check current selected word

        * WebView.subproj/WebFrameViewInternal.h: Moved WebFrameViewPrivate inside the WebFrameView.m file.
        Removed a bunch of methods that don't need to be seen in other files, and added _verticalPageScrollDistance.
        * WebView.subproj/WebFrameViewPrivate.h: Removed. Renamed to WebFrameViewInternal.h.
        * WebView.subproj/WebFrameView.m:
        (-[WebFrameView _verticalKeyboardScrollDistance]): Move in the file because of internal vs. private.
        (-[WebFrameView _shouldDrawBorder]): Ditto.
        (-[WebFrameView _tile]): Ditto.
        (-[WebFrameView _verticalPageScrollDistance]): Added. Separate method so it can be called
        by the code to implement pageDown:.
        (-[WebFrameView _drawBorder]): Move in the file because of internal vs. private.
        (-[WebFrameView _goBack]): Ditto.
        (-[WebFrameView _goForward]): Ditto.
        (-[WebFrameView _scrollVerticallyBy:]): Ditto.
        (-[WebFrameView _scrollHorizontallyBy:]): Ditto.
        (-[WebFrameView _horizontalKeyboardScrollDistance]): Ditto.
        (-[WebFrameView _horizontalPageScrollDistance]): Added. Separate method for consistency with
        vertical method above.
        (-[WebFrameView _pageVertically:]): Moved and changed to use _verticalPageScrollDistance.
        (-[WebFrameView _pageHorizontally:]): Moved and changed to use _horizontalPageScrollDistance.
        (-[WebFrameView _scrollLineVertically:]): Move in the file because of internal vs. private.
        (-[WebFrameView _scrollLineHorizontally:]): Ditto.
        (-[WebFrameView scrollPageUp:]): Ditto.
        (-[WebFrameView scrollPageDown:]): Ditto.
        (-[WebFrameView scrollLineUp:]): Ditto.
        (-[WebFrameView scrollLineDown:]): Ditto.
        (-[WebFrameView _firstResponderIsControl]): Ditto.
        (-[WebFrameView keyDown:]): Changed to eliminate _pageLeft, _lineLeft, _pageRight, and _lineRight.

        * WebView.subproj/WebDataSource.m: Use WebFrameView.h instead of WebFrameViewPrivate.h.

        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _alterCurrentSelection:verticalDistance:]): Added.
        (-[WebHTMLView moveToBeginningOfDocument:]): Use WebSelectToDocumentBoundary.
        (-[WebHTMLView moveToBeginningOfDocumentAndModifySelection:]): Ditto.
        (-[WebHTMLView moveToEndOfDocument:]): Ditto.
        (-[WebHTMLView moveToEndOfDocumentAndModifySelection:]): Ditto.
        (-[WebHTMLView moveParagraphBackwardAndModifySelection:]): Added.
        (-[WebHTMLView moveParagraphForwardAndModifySelection:]): Added.
        (-[WebHTMLView pageUp:]): Added.
        (-[WebHTMLView pageDown:]): Added.
        (-[WebHTMLView pageUpAndModifySelection:]): Added.
        (-[WebHTMLView pageDownAndModifySelection:]): Added.
        (-[WebHTMLView showGuessPanel:]): Changed to call advanceToNextMisspellingStartingJustBeforeSelection.
        This fixes the problem with spell checking.

        * WebView.subproj/WebImageView.m:
        (-[WebImageView webView]): Changed to use _web_parentWebView.
        (-[WebImageView menuForEvent:]): Changed to use [self webView].
        (-[WebImageView mouseDown:]): Ditto.
        (-[WebImageView mouseDragged:]): Ditto.
        (-[WebImageView draggedImage:endedAt:operation:]): Ditto.

        * WebView.subproj/WebTextView.m:
        (-[WebTextView _textSizeMultiplierFromWebView]): Changed to use _web_parentWebView.
        (-[WebTextView menuForEvent:]): Ditto.
        (-[WebTextView drawPageBorderWithSize:]): Ditto.
        (-[WebTextView knowsPageRange:]): Ditto.

        * Plugins.subproj/WebPluginDatabase.m: Updated filename of WebFrameViewInternal.h.
        * WebCoreSupport.subproj/WebBridge.m: Ditto.
        * WebKit.pbproj/project.pbxproj: Ditto.
        * WebView.subproj/WebFrame.m: Ditto.
        * WebView.subproj/WebView.m: Ditto.
        * Misc.subproj/WebNSViewExtras.m: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
41 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/ForwardingHeaders/dom/dom_position.h [deleted file]
WebCore/khtml/css/cssstyleselector.cpp
WebCore/khtml/editing/SelectionController.cpp
WebCore/khtml/editing/SelectionController.h
WebCore/khtml/editing/htmlediting.cpp
WebCore/khtml/editing/htmlediting_impl.cpp
WebCore/khtml/editing/selection.cpp
WebCore/khtml/editing/selection.h
WebCore/khtml/editing/visible_position.cpp
WebCore/khtml/editing/visible_position.h
WebCore/khtml/misc/helper.cpp
WebCore/khtml/misc/helper.h
WebCore/khtml/rendering/render_canvas.cpp
WebCore/khtml/xml/dom_caretposition.cpp
WebCore/khtml/xml/dom_caretposition.h
WebCore/khtml/xml/dom_position.cpp
WebCore/khtml/xml/dom_position.h
WebCore/khtml/xml/dom_selection.cpp
WebCore/khtml/xml/dom_selection.h
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/KWQTextUtilities.cpp
WebCore/kwq/KWQTextUtilities.h
WebCore/kwq/KWQTextUtilities.mm
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreBridge.mm
WebKit/ChangeLog
WebKit/Misc.subproj/WebNSViewExtras.m
WebKit/Plugins.subproj/WebPluginDatabase.m
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebKit.pbproj/project.pbxproj
WebKit/WebView.subproj/WebDataSource.m
WebKit/WebView.subproj/WebFrame.m
WebKit/WebView.subproj/WebFramePrivate.h [deleted file]
WebKit/WebView.subproj/WebFrameView.m
WebKit/WebView.subproj/WebFrameViewInternal.h
WebKit/WebView.subproj/WebHTMLView.m
WebKit/WebView.subproj/WebImageView.m
WebKit/WebView.subproj/WebTextView.m
WebKit/WebView.subproj/WebView.m