mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
LibWeb: Require existing Selection for .execCommand("selectAll")
Disable the command if no selection is available. This is a spec bug: https://github.com/w3c/editing/issues/475 Fixes #3325
This commit is contained in:
committed by
Tim Ledbetter
parent
96e074b38f
commit
d967f56936
Notes:
github-actions[bot]
2025-01-21 02:28:49 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/d967f56936e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3328 Reviewed-by: https://github.com/tcl3 ✅
@@ -33,5 +33,17 @@
|
||||
// Perform selectAll
|
||||
document.execCommand('selectAll');
|
||||
reportSelection();
|
||||
|
||||
// Report whether command is enabled and make sure it does not crash
|
||||
const documents = [
|
||||
document,
|
||||
new Document(),
|
||||
document.implementation.createHTMLDocument(),
|
||||
];
|
||||
for (const doc of documents) {
|
||||
println(doc.queryCommandEnabled('selectAll'));
|
||||
doc.execCommand('selectAll');
|
||||
}
|
||||
println('Did not crash!');
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user