diff --git a/Libraries/LibWeb/HTML/HTMLElement.cpp b/Libraries/LibWeb/HTML/HTMLElement.cpp index afdc504184..1a9df555ed 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -314,6 +314,8 @@ static Vector> rendered_text_collec auto* layout_node = node.layout_node(); if (!layout_node) return items; + if (!layout_node->has_style_or_parent_with_style()) + return items; auto const& computed_values = layout_node->computed_values(); diff --git a/Tests/LibWeb/Crash/HTML/style-outer-text-after-adoption.html b/Tests/LibWeb/Crash/HTML/style-outer-text-after-adoption.html new file mode 100644 index 0000000000..e0a711fc84 --- /dev/null +++ b/Tests/LibWeb/Crash/HTML/style-outer-text-after-adoption.html @@ -0,0 +1,8 @@ + + +