Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
<script>
"use strict";
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(async () => {
let iframe = document.querySelector("iframe");
async function resetIframe() {
iframe?.remove();
iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.srcdoc = "<body></body>";
if (iframe.contentDocument?.readyState != "complete") {
await new Promise(resolve => iframe.addEventListener("load", resolve, {once: true}));
}
iframe.contentWindow.focus();
}
await resetIframe();
iframe.contentDocument.body.innerHTML = "<div contenteditable><br></div>";
ok(
iframe.contentDocument.queryCommandSupported("enableCompatibleJoinSplitDirection"),
"command should be supported"
);
ok(
iframe.contentDocument.queryCommandEnabled("enableCompatibleJoinSplitDirection"),
"command should be enabled"
);
ok(
iframe.contentDocument.queryCommandState("enableCompatibleJoinSplitDirection"),
"command state should be true"
);
is(
iframe.contentDocument.queryCommandValue("enableCompatibleJoinSplitDirection"),
"",
"command value should be empty string"
);
ok(
!iframe.contentDocument.execCommand("enableCompatibleJoinSplitDirection", false, "false"),
"command to disable it should return false"
);
ok(
iframe.contentDocument.queryCommandState("enableCompatibleJoinSplitDirection"),
"command state should be true even after executing the command to disable it"
);
SimpleTest.finish();
});
</script>
</head>
<body></body>
</html>