diff --git a/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index 0f40cf43704..0deb6522c19 100644 --- a/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace Web::HTML { @@ -88,8 +89,7 @@ WebIDL::ExceptionOr HTMLOptionElement::set_value(String const& value) static void concatenate_descendants_text_content(DOM::Node const* node, StringBuilder& builder) { - // FIXME: SVGScriptElement should also be skipped, but it doesn't exist yet. - if (is(node)) + if (is(node) || is(node)) return; if (is(node)) builder.append(verify_cast(node)->data()); diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-text-recurse.txt b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-text-recurse.txt index 3c3b5037c1f..933c15dbf49 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-text-recurse.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-text-recurse.txt @@ -6,12 +6,11 @@ Rerun Found 11 tests -10 Pass -1 Fail +11 Pass Details Result Test Name MessagePass option.text should recurse Pass option.text should not recurse into HTML script elements -Fail option.text should not recurse into SVG script elements +Pass option.text should not recurse into SVG script elements Pass option.text should recurse into MathML script elements Pass option.text should recurse into null script elements Pass option.text should work if a child of the option ends with a script