Bug 787434 - part 3: Change the expectation of a test in copypaste.js r=mbrodesser

It tries to test an assertion failure bug which was fixed by bug 1127835.
It expects that empty `<a href="...">` element coming from the clipboard should
be deleted.  However, this now mismatches with the new behavior which wants to
keep elements for web-compat and avoiding any dataloss.  Therefore, we
need to change the expectation for conforming to the new behavior.

Differential Revision: https://phabricator.services.mozilla.com/D136212
This commit is contained in:
Masayuki Nakano 2022-02-02 00:44:54 +00:00
parent 6455ee48a9
commit ee4740158a

View file

@ -432,17 +432,17 @@ async function testCopyPaste(isXHTML) {
var r = document.createRange();
r.setStart(t1, 1);
r.setEnd(e2, 0);
sel.addRange(r);
sel.addRange(r); // <div>\n<span id="1127835crash1">1[</span><div id="1127835crash2">}<div>\n</div></div><a href="..." id="1127835crash3">3</a>\n</div>
r = document.createRange();
r.setStart(e2, 1);
r.setEnd(t3, 0);
sel.addRange(r);
sel.addRange(r); // <div>\n<span id="1127835crash1">1</span><div id="1127835crash2"><div>\n</div>{</div><a href="..." id="1127835crash3">]3</a>\n</div>
await copySelectionToClipboard(true);
testPasteHTML(
"contentEditable6",
'<span id="1127835crash1"></span><div id="1127835crash2"><div>\n</div></div><br>'
);
'<span id="1127835crash1"></span><div id="1127835crash2"><div>\n</div></div><a href="http://www.mozilla.org/" id="1127835crash3"><br></a>'
); // Don't strip the empty `<a href="...">` element because of avoiding any dataloss provided by the element
}
// ============ copy/paste test from/to a textarea