From 324460324818d8c11892d690a58d5b7b37b2209d Mon Sep 17 00:00:00 2001 From: Chirag M Shah Date: Fri, 2 Dec 2022 11:23:12 -0800 Subject: [PATCH] Don't crash when RenderStyle is NULL for elements like optgroup when rendering https://bugs.webkit.org/show_bug.cgi?id=248575 Reviewed by Simon Fraser. * LayoutTests/fast/rendering/render-style-null-optgroup-crash-expected.txt: Added. * LayoutTests/fast/rendering/render-style-null-optgroup-crash.html: Added. * Source/WebCore/rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItemForeground): (WebCore::RenderListBox::paintItemBackground): Canonical link: https://commits.webkit.org/257295@main --- ...der-style-null-optgroup-crash-expected.txt | 1 + .../render-style-null-optgroup-crash.html | 22 +++++++++++++++++++ Source/WebCore/rendering/RenderListBox.cpp | 20 ++++++++++------- 3 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 LayoutTests/fast/rendering/render-style-null-optgroup-crash-expected.txt create mode 100644 LayoutTests/fast/rendering/render-style-null-optgroup-crash.html diff --git a/LayoutTests/fast/rendering/render-style-null-optgroup-crash-expected.txt b/LayoutTests/fast/rendering/render-style-null-optgroup-crash-expected.txt new file mode 100644 index 0000000000000..7ef22e9a431ad --- /dev/null +++ b/LayoutTests/fast/rendering/render-style-null-optgroup-crash-expected.txt @@ -0,0 +1 @@ +PASS diff --git a/LayoutTests/fast/rendering/render-style-null-optgroup-crash.html b/LayoutTests/fast/rendering/render-style-null-optgroup-crash.html new file mode 100644 index 0000000000000..f1710a5b6a9c2 --- /dev/null +++ b/LayoutTests/fast/rendering/render-style-null-optgroup-crash.html @@ -0,0 +1,22 @@ + + + +
+