mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 737889 - Part 2: Stop the propagarion of drag/drop events over non-editable content; r=roc
This commit is contained in:
parent
2df3a82068
commit
d408136238
@ -676,11 +676,7 @@ nsEditorEventListener::DragOver(nsIDOMDragEvent* aDragEvent)
|
||||
nsCOMPtr<nsIContent> dropParent = do_QueryInterface(parent);
|
||||
NS_ENSURE_TRUE(dropParent, NS_ERROR_FAILURE);
|
||||
|
||||
if (!dropParent->IsEditable()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (CanDrop(aDragEvent)) {
|
||||
if (dropParent->IsEditable() && CanDrop(aDragEvent)) {
|
||||
aDragEvent->PreventDefault(); // consumed
|
||||
|
||||
if (mCaret) {
|
||||
@ -754,11 +750,7 @@ nsEditorEventListener::Drop(nsIDOMDragEvent* aMouseEvent)
|
||||
nsCOMPtr<nsIContent> dropParent = do_QueryInterface(parent);
|
||||
NS_ENSURE_TRUE(dropParent, NS_ERROR_FAILURE);
|
||||
|
||||
if (!dropParent->IsEditable()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (!CanDrop(aMouseEvent)) {
|
||||
if (!dropParent->IsEditable() || !CanDrop(aMouseEvent)) {
|
||||
// was it because we're read-only?
|
||||
if (mEditor->IsReadonly() || mEditor->IsDisabled())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user