mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
29 lines
1.1 KiB
HTML
29 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<body></body>
|
|
<script>
|
|
function execCommandCaseInsensitivityTest(command) {
|
|
return new Promise((resolve) => {
|
|
const iframe = document.createElement("iframe");
|
|
iframe.srcdoc = `<div>PASS</div>`;
|
|
document.body.appendChild(iframe);
|
|
iframe.onload = () => {
|
|
const iframeDocument = iframe.contentDocument;
|
|
iframeDocument.execCommand(command);
|
|
|
|
const selection = iframeDocument.getSelection();
|
|
println(`queryCommandSupported("${command}"): ${iframeDocument.queryCommandSupported(command)}`);
|
|
println(`queryCommandEnabled("${command}"): ${iframeDocument.queryCommandEnabled(command)}`);
|
|
println(`execCommand("${command}"): ${selection.toString()}`);
|
|
iframe.remove();
|
|
resolve();
|
|
};
|
|
});
|
|
}
|
|
asyncTest(async done => {
|
|
for (command of ["selectall", "SELECTALL", "SeLeCtAlL"]) {
|
|
await execCommandCaseInsensitivityTest(command);
|
|
}
|
|
done();
|
|
});
|
|
</script>
|