LayoutTests:
authorantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 May 2007 22:25:01 +0000 (22:25 +0000)
committerantti <antti@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 May 2007 22:25:01 +0000 (22:25 +0000)
commit229f00613dc7397054df6f038a4a32e917ddf49c
tree6a052e28becf7a2d5dd95febd39e4407e3ba3c97
parent137fd9e7a83007ac49eac4b61bd4ff5fc96cf79c
LayoutTests:

        Reviewed by Darin.

        Test for http://bugs.webkit.org/show_bug.cgi?id=13727
        REGRESSION: Reproducible hang setting the selection's extent offset to -1
        <rdar://problem/5206890>

        * LayoutTests/editing/selection/selection-invalid-offset-expected.txt: Added.
        * LayoutTests/editing/selection/selection-invalid-offset.html: Added.

WebCore:

        Reviewed by Darin.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=13727
        REGRESSION: Reproducible hang setting the selection's extent offset to -1
        <rdar://problem/5206890>

        Rise INDEX_SIZE_ERR if used selection index is negative. This matches HTML5 for
        getRangeAt() and collapse() which are part of the spec (FF throws NS_ERROR_FAILURE).

        Not throwing exceptions yet for too high offsets (except getRangeAt()) as it is
        unclear if WebCore's definition of offsets is the same as other browsers.

        * bindings/js/kjs_window.cpp:
        * WebCore/editing/SelectionController.cpp:
        * WebCore/editing/SelectionController.h:
        * WebCore/editing/VisiblePosition.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/selection-invalid-offset-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/selection-invalid-offset.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bindings/js/kjs_window.cpp
WebCore/editing/SelectionController.cpp
WebCore/editing/SelectionController.h
WebCore/editing/VisiblePosition.cpp