Bug 1464205 - Clear cached values unconditionally in DataTransferItemList::SetDataWithPrincipal, r=Nika
authorAnny Gakhokidze <agakhokidze@mozilla.com>
Fri, 25 May 2018 10:35:43 -0400
changeset 421008 4231bd54fb2f
parent 421007 cfdc0001c91b
child 421009 94ffa7844ae7
push id34088
push userdluca@mozilla.com
push dateMon, 04 Jun 2018 17:56:32 +0000
treeherdermozilla-central@5b15326286d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNika
bugs1464205
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1464205 - Clear cached values unconditionally in DataTransferItemList::SetDataWithPrincipal, r=Nika MozReview-Commit-ID: 9HLkDwNkdo7
dom/events/DataTransferItemList.cpp
--- a/dom/events/DataTransferItemList.cpp
+++ b/dom/events/DataTransferItemList.cpp
@@ -355,20 +355,18 @@ DataTransferItemList::SetDataWithPrincip
                         || !subsumes))) {
           aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
           return nullptr;
         }
         item->SetPrincipal(aPrincipal);
 
         DataTransferItem::eKind oldKind = item->Kind();
         item->SetData(aData);
-        if (oldKind != item->Kind()) {
-          // Types list may have changed, even if aIndex == 0.
-          mDataTransfer->TypesListMayHaveChanged();
-        }
+
+        mDataTransfer->TypesListMayHaveChanged();
 
         if (aIndex != 0) {
           // If the item changes from being a file to not a file or vice-versa,
           // its presence in the mItems array may need to change.
           if (item->Kind() == DataTransferItem::KIND_FILE &&
               oldKind != DataTransferItem::KIND_FILE) {
             // not file => file
             mItems.AppendElement(item);