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 420883 4231bd54fb2f
parent 420882 cfdc0001c91b
child 420884 94ffa7844ae7
push id64757
push usernlayzell@mozilla.com
push dateFri, 01 Jun 2018 17:21:30 +0000
treeherderautoland@4231bd54fb2f [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);