mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 11:48:06 +00:00
LibWeb: Add name validation and document check to setAttribute
Co-authored-by: Rayyan Hamid <rayyanbwp@gmail.com> Co-authored-by: Christian Ewing <u1273549@utah.edu> Co-authored-by: Austin Fashimpaur <austin.fashimpaur@gmail.com>
This commit is contained in:
parent
5ed7cd6e32
commit
13abb1b2c7
Notes:
sideshowbarker
2024-07-17 07:16:27 +09:00
Author: https://github.com/alextrnnn 🔰
Commit: 13abb1b2c7
Pull-request: https://github.com/SerenityOS/serenity/pull/24000
Reviewed-by: https://github.com/trflynn89 ✅
6 changed files with 45 additions and 8 deletions
|
@ -0,0 +1,21 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let e = document.createElement('div');
|
||||
function testInvalidQualifiedName(name) {
|
||||
try {
|
||||
e.setAttribute(name, 'bar');
|
||||
println('FAIL')
|
||||
} catch (e) {
|
||||
println('OK: ' + e);
|
||||
}
|
||||
}
|
||||
|
||||
invalidNames =
|
||||
['', '1foo', 'f@oo', 'foo!']
|
||||
|
||||
for (let i = 0; i < invalidNames.length; i++) {
|
||||
testInvalidQualifiedName(invalidNames[i])
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue