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