Reviewed by John
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Sep 2004 17:51:52 +0000 (17:51 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Sep 2004 17:51:52 +0000 (17:51 +0000)
commit29833ab4d42840519089cfbb1f056d49ea6fca7e
tree11788c5377af5f3e40242b433dfce2c1d66675f2
parent21794f0dab63e3041cbd4cc97c2ba05c8aefb7d5
    Reviewed by John

        Fix for this bug:

        <rdar://problem/3815895> exception inside fontForSelection causes Mail to abort when selection hits bottom

        * khtml/editing/selection.cpp:
        (khtml::Selection::toRange): Use RangeImpl calls to detect exceptions when creating a Range
        from a Selection. Return an empty Range when there is an exception.

        Fix for this bug:

        <rdar://problem/3817268> REGRESSION (Mail): Window does not scroll when selecting out of
        visible area of view with arrow keys

        * khtml/editing/selection.cpp: Did some name changing. m_needsCaretLayout -> m_needsLayout.
        Added m_expectedVisibleRect which supplies the right rectangle to update when scrolling.
        (khtml::Selection::Selection): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::init): Handle m_expectedVisibleRect in initialization.
        (khtml::Selection::operator=): Handle m_expectedVisibleRect in assignment.
        (khtml::Selection::setNeedsLayout): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::layout): Changed name from layoutCaret, since m_expectedVisibleRect
        is also calculated here.
        (khtml::Selection::caretRect): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::expectedVisibleRect): New. Returns m_expectedVisibleRect, doing a
        layout if needed.
        (khtml::Selection::needsCaretRepaint): m_needsCaretLayout -> m_needsLayout name change.
        (khtml::Selection::paintCaret): Ditto.
        (khtml::Selection::validate): Ditto.
        * khtml/editing/selection.h: Add m_expectedVisibleRect member variable and
        expectedVisibleRect accessor.
        * kwq/WebCoreBridge.h: Change name of ensureCaretVisible to ensureSelectionVisible, since
        this is not only about making the caret visible anymore. Now it can reveal the varying
        end of the selection when scrolling with arrow keys.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge alterCurrentSelection:direction:granularity:]): ensureCaretVisible to
        ensureSelectionVisible name change.
        (-[WebCoreBridge alterCurrentSelection:verticalDistance:]): Ditto
        (-[WebCoreBridge replaceSelectionWithFragment:selectReplacement:smartReplace:]): Ditto
        (-[WebCoreBridge insertNewline]): Ditto
        (-[WebCoreBridge insertText:selectInsertedText:]): Ditto
        (-[WebCoreBridge deleteKeyPressed]): Ditto
        (-[WebCoreBridge ensureSelectionVisible]): Ditto

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