Bug 1689827 - Remove length parameter from JS callers of setTransferData. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D103555
This commit is contained in:
Tom Schuster
2021-02-01 12:05:12 +00:00
parent 284007d949
commit f7d112c734
19 changed files with 27 additions and 40 deletions

View File

@@ -1451,7 +1451,7 @@ function copyRawDataToClipboard(button) {
].createInstance(Ci.nsITransferable);
transferable.init(getLoadContext());
transferable.addDataFlavor("text/unicode");
transferable.setTransferData("text/unicode", str, str.data.length * 2);
transferable.setTransferData("text/unicode", str);
Services.clipboard.setData(
transferable,
null,
@@ -1501,12 +1501,12 @@ async function copyContentsToClipboard() {
// Add the HTML flavor.
transferable.addDataFlavor("text/html");
ssHtml.data = dataHtml;
transferable.setTransferData("text/html", ssHtml, dataHtml.length * 2);
transferable.setTransferData("text/html", ssHtml);
// Add the plain text flavor.
transferable.addDataFlavor("text/unicode");
ssText.data = dataText;
transferable.setTransferData("text/unicode", ssText, dataText.length * 2);
transferable.setTransferData("text/unicode", ssText);
// Store the data into the clipboard.
Services.clipboard.setData(