mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Disallow Editing API calls on non-HTML documents
This is not directly mentioned in the Editing API spec, but all major browsers do this and there is a WPT for this behavior.
This commit is contained in:
parent
2cee6aeba3
commit
a0b0e91d4f
Notes:
github-actions[bot]
2025-01-21 18:09:45 +00:00
Author: https://github.com/tcl3
Commit: a0b0e91d4f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3332
Reviewed-by: https://github.com/gmta ✅
8 changed files with 89 additions and 31 deletions
|
@ -41,8 +41,12 @@
|
|||
document.implementation.createHTMLDocument(),
|
||||
];
|
||||
for (const doc of documents) {
|
||||
println(doc.queryCommandEnabled('selectAll'));
|
||||
doc.execCommand('selectAll');
|
||||
try {
|
||||
println(doc.queryCommandEnabled('selectAll'));
|
||||
doc.execCommand('selectAll');
|
||||
} catch (e) {
|
||||
println(`queryCommandEnabled threw exception of type: ${e.name}`);
|
||||
}
|
||||
}
|
||||
println('Did not crash!');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue