Bug 1464205 - Clear cached values unconditionally in DataTransferItemList::SetDataWithPrincipal, r=nika
MozReview-Commit-ID: 9HLkDwNkdo7
--- 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);