Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- Manifest: dom/base/test/chrome/chrome.toml
<?xml version="1.0"?>
<html:body>
<xul:hbox>
<html:input id="xul-parent" />
</xul:hbox>
<html:div>
<html:input id="plain" />
<html:input id="with-attribute" preserveundohistory="" />
</html:div>
</html:body>
<script class="testbody">
SimpleTest.waitForExplicitFinish();
function shouldPreserveHistory(input, preserve) {
input.focus();
input.value = "abc";
input.value = "def";
let ctrl = navigator.platform.indexOf("Mac") == 0 ? { metaKey: true } : { ctrlKey: true };
synthesizeKey("z", ctrl);
(preserve ? is : isnot)(input.value, "abc", `Expected ${input.id} to ${preserve ? "" : "not "}preserve undo history when setting .value`);
}
window.onload = function() {
shouldPreserveHistory(document.getElementById("xul-parent"), false);
shouldPreserveHistory(document.getElementById("plain"), false);
shouldPreserveHistory(document.getElementById("with-attribute"), true);
SimpleTest.finish();
}
</script>
</window>