From b62043dbca047cb83aa6acd3d9b6bd65c54ef15e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 11 Sep 2020 18:37:18 +0200 Subject: [PATCH] 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. :^) --- Base/res/html/misc/checkbox.html | 11 +++++++++++ Base/res/html/misc/welcome.html | 1 + Libraries/LibWeb/Layout/LayoutCheckBox.cpp | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 Base/res/html/misc/checkbox.html diff --git a/Base/res/html/misc/checkbox.html b/Base/res/html/misc/checkbox.html new file mode 100644 index 0000000000..86b8198b0c --- /dev/null +++ b/Base/res/html/misc/checkbox.html @@ -0,0 +1,11 @@ + + This is a checkbox +

+    
+
diff --git a/Base/res/html/misc/welcome.html b/Base/res/html/misc/welcome.html
index 3d5046bb30..3016ccb2f7 100644
--- a/Base/res/html/misc/welcome.html
+++ b/Base/res/html/misc/welcome.html
@@ -31,6 +31,7 @@ span#ua {
     

Your user agent is:

Some small test pages: