зеркало из https://github.com/mozilla/gecko-dev.git
Bug 737889 - Part 2: Stop the propagarion of drag/drop events over non-editable content; r=roc
This commit is contained in:
Родитель
2df3a82068
Коммит
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())
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче