Assert in MoveSelectionCommand::doApply

https://bugs.webkit.org/show_bug.cgi?id=70277

Patch by Devdatta Deshpande <pwjd73@motorola.com> on 2011-11-02
Reviewed by Ryosuke Niwa.

Source/WebCore:

A MoveSelectionCommand should be fired only if the selection type is
RangeSelection, since nothing is selected in other cases.

Test: fast/events/drag-link.html

* page/DragController.cpp:
(WebCore::DragController::dragIsMove):

LayoutTests:

Test to drag-drop anchor element on an already focused editable div
element.

* fast/events/drag-link-expected.txt: Added.
* fast/events/drag-link.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b4908588
2011-11-02 Devdatta Deshpande <pwjd73@motorola.com>
Assert in MoveSelectionCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=70277
Reviewed by Ryosuke Niwa.
Test to drag-drop anchor element on an already focused editable div
element.
* fast/events/drag-link-expected.txt: Added.
* fast/events/drag-link.html: Added.
2011-11-02 Tony Chang <tony@chromium.org>
Try to deflake http/tests/multipart/policy-ignore-crash.php by
Test for bug 70277. This tests that a link is dragged and dropped properly in an already focused editable area. This test passes only if it does not hit an assertion.
Test Link
Editable area
Test Link
PASS
<!DOCTYPE html>
<html>
<body>
<div>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=70277">bug 70277</a>.
This tests that a link is dragged and dropped properly in an already focused editable area.
This test passes only if it does not hit an assertion.
</p>
<a href=# id="anchorElement">Test Link</a>
</div>
<div id="editableDiv" contenteditable="true">
<h3>Editable area</h3>
<br>
<br>
</div>
<div id="result">
</div>
<script>
function dragElement(srcElement, destElement)
{
eventSender.mouseMoveTo(srcElement.offsetLeft + srcElement.offsetWidth / 2,
srcElement.offsetTop + srcElement.offsetHeight / 2);
eventSender.mouseDown();
eventSender.leapForward(100);
eventSender.mouseMoveTo(destElement.offsetLeft + destElement.offsetWidth / 2,
destElement.offsetTop + destElement.offsetHeight / 2);
eventSender.mouseUp();
document.getElementById('result').innerHTML = "PASS";
}
if (window.layoutTestController)
layoutTestController.dumpAsText();
var editableDiv = document.getElementById('editableDiv');
editableDiv.focus();
dragElement(document.getElementById('anchorElement'), editableDiv);
</script>
</body>
</html>
2011-11-02 Devdatta Deshpande <pwjd73@motorola.com>
Assert in MoveSelectionCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=70277
Reviewed by Ryosuke Niwa.
A MoveSelectionCommand should be fired only if the selection type is
RangeSelection, since nothing is selected in other cases.
Test: fast/events/drag-link.html
* page/DragController.cpp:
(WebCore::DragController::dragIsMove):
2011-11-02 Jon Lee <jonlee@apple.com>
<input=file multiple> default text uses singular instead of plural
......
......@@ -144,7 +144,7 @@ static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragD
bool DragController::dragIsMove(FrameSelection* selection, DragData* dragData)
{
return m_documentUnderMouse == m_dragInitiator && selection->isContentEditable() && !isCopyKeyDown(dragData);
return m_documentUnderMouse == m_dragInitiator && selection->isContentEditable() && selection->isRange() && !isCopyKeyDown(dragData);
}
// FIXME: This method is poorly named. We're just clearing the selection from the document this drag is exiting.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment