2011-04-11 Ryosuke Niwa <rniwa@webkit.org>
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 01:33:48 +0000 (01:33 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 01:33:48 +0000 (01:33 +0000)
commit588453d815f8494820b71509251b57314483d302
treefe62cc308ebc786ab710d4ceba37a25906cc6c90
parent36724c7f3c6436d198fd376dca07924be957f7d5
2011-04-11  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Tony Chang.

        [chromium] Crash in WebViewImpl::caretOrSelectionBounds
        https://bugs.webkit.org/show_bug.cgi?id=58269

        The bug was caused by caretOrSelectionBounds's incorrectly assuming
        SelectionController::toNormalizedRange to always return a non-null Range.

        Fixed the bug by adding a null pointer check. Also replaced calls to deprecatedNode
        by containerNode() and calls to SelectionController::start() and SelectionController::end()
        by calls to SelectionController::base() and SelectionController::extent() because
        selection extends from base to extent, not from start to end.

        Test: editing/selection/extend-over-file-input-by-drag-crash.html

        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::caretOrSelectionBounds):
2011-04-11  Ryosuke Niwa  <rniwa@webkit.org>

        Reviewed by Tony Chang.

        [chromium] Crash in WebViewImpl::caretOrSelectionBounds
        https://bugs.webkit.org/show_bug.cgi?id=58269

        Added a test to ensure WebKit does not crash when selecting over a file input element.
        While the bug was specific to Chromium port, the test will be run on all ports because
        all other ports should not crash either.

        * editing/selection/extend-over-file-input-by-drag-crash-expected.txt: Added.
        * editing/selection/extend-over-file-input-by-drag-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/selection/extend-over-file-input-by-drag-crash-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/extend-over-file-input-by-drag-crash.html [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp