mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 09:17:34 +00:00
LibWeb: Protect LayoutCheckBox against crashes after event dispatch
After dispatching a "change" event due to the checked state being modified, we may have been removed from the layout tree. Make LayoutCheckBox protect itself to prevent this from crashing. Also, add a little test page for checkboxes. :^)
This commit is contained in:
parent
71092226bd
commit
b62043dbca
3 changed files with 15 additions and 0 deletions
11
Base/res/html/misc/checkbox.html
Normal file
11
Base/res/html/misc/checkbox.html
Normal file
|
@ -0,0 +1,11 @@
|
|||
<html>
|
||||
<input id=foo type=checkbox> This is a checkbox
|
||||
<pre id=bar></pre>
|
||||
<script>
|
||||
var foo = document.getElementById("foo");
|
||||
var bar = document.getElementById("bar");
|
||||
foo.addEventListener("change", function() {
|
||||
bar.innerHTML += foo.checked + "\n";
|
||||
});
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue