mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Don't include SVG script element in HTMLOptionElement.text
We had an old FIXME for this from times before SVGScriptElement was a thing in our codebase.
This commit is contained in:
committed by
Andreas Kling
parent
4c2d4cdf50
commit
77d30a0cb7
@@ -17,6 +17,7 @@
|
|||||||
#include <LibWeb/HTML/HTMLSelectElement.h>
|
#include <LibWeb/HTML/HTMLSelectElement.h>
|
||||||
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
|
#include <LibWeb/HighResolutionTime/TimeOrigin.h>
|
||||||
#include <LibWeb/Infra/Strings.h>
|
#include <LibWeb/Infra/Strings.h>
|
||||||
|
#include <LibWeb/SVG/SVGScriptElement.h>
|
||||||
|
|
||||||
namespace Web::HTML {
|
namespace Web::HTML {
|
||||||
|
|
||||||
@@ -88,8 +89,7 @@ WebIDL::ExceptionOr<void> HTMLOptionElement::set_value(String const& value)
|
|||||||
|
|
||||||
static void concatenate_descendants_text_content(DOM::Node const* node, StringBuilder& builder)
|
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<HTMLScriptElement>(node) || is<SVG::SVGScriptElement>(node))
|
||||||
if (is<HTMLScriptElement>(node))
|
|
||||||
return;
|
return;
|
||||||
if (is<DOM::Text>(node))
|
if (is<DOM::Text>(node))
|
||||||
builder.append(verify_cast<DOM::Text>(node)->data());
|
builder.append(verify_cast<DOM::Text>(node)->data());
|
||||||
|
|||||||
@@ -6,12 +6,11 @@ Rerun
|
|||||||
|
|
||||||
Found 11 tests
|
Found 11 tests
|
||||||
|
|
||||||
10 Pass
|
11 Pass
|
||||||
1 Fail
|
|
||||||
Details
|
Details
|
||||||
Result Test Name MessagePass option.text should recurse
|
Result Test Name MessagePass option.text should recurse
|
||||||
Pass option.text should not recurse into HTML script elements
|
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 MathML script elements
|
||||||
Pass option.text should recurse into null 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
|
Pass option.text should work if a child of the option ends with a script
|
||||||
|
|||||||
Reference in New Issue
Block a user