Bug 1464205 - Clear cached values unconditionally in DataTransferItemList::SetDataWithPrincipal, r=nika draft
authorAnny Gakhokidze <agakhokidze@mozilla.com>
Fri, 25 May 2018 10:35:43 -0400
changeset 800767 d3843ebc0840
parent 800766 27164d95730e
child 800768 0a0cdffefd8f
push id111476
push userbmo:agakhokidze@mozilla.com
push dateTue, 29 May 2018 04:51:15 +0000
reviewersnika
bugs1464205
milestone62.0a1
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
@@ -356,20 +356,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);