Skip to content

Truly independent web browser

LibWeb: Only use the label and value attributes in the null namespace

Andreas Klingb3a2e4327295
diff --git a/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Libraries/LibWeb/HTML/HTMLOptionElement.cpp
index 12fc0602409..a48b8f4dde0 100644
--- a/Libraries/LibWeb/HTML/HTMLOptionElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLOptionElement.cpp
@@ -105,7 +105,7 @@ Utf16String HTMLOptionElement::value() const
{
// The value of an option element is the value of the value content attribute, if there is one.
// ...or, if there is not, the value of the element's text IDL attribute.
- if (auto value = attribute(HTML::AttributeNames::value); value.has_value())
+ if (auto value = get_attribute_ns({}, HTML::AttributeNames::value); value.has_value())
return value.release_value();
return text();
}
@@ -133,7 +133,7 @@ Utf16String HTMLOptionElement::label() const
{
// The label IDL attribute, on getting, if there is a label content attribute,
// must return that attribute's value; otherwise, it must return the element's label.
- if (auto label = attribute(HTML::AttributeNames::label); label.has_value())
+ if (auto label = get_attribute_ns({}, HTML::AttributeNames::label); label.has_value())
return label.release_value();
return text();
}
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-label.txt b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-label.txt
index 648582eec35..ac56839c790 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-label.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-label.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-9 Pass
-3 Fail
+12 Pass
Pass No children, no label
Pass No children, empty label
Pass No children, label
-Fail No children, namespaced label
+Pass No children, namespaced label
Pass Single child, no label
Pass Single child, empty label
Pass Single child, label
-Fail Single child, namespaced label
+Pass Single child, namespaced label
Pass Two children, no label
Pass Two children, empty label
Pass Two children, label
-Fail Two children, namespaced label
\ No newline at end of file
+Pass Two children, namespaced label
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-value.txt b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-value.txt
index 82ac1f6bbb3..b28c0b02942 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-value.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/html/semantics/forms/the-option-element/option-value.txt
@@ -2,17 +2,16 @@ Harness status: OK
Found 12 tests
-9 Pass
-3 Fail
+12 Pass
Pass No children, no value
Pass No children, empty value
Pass No children, value
-Fail No children, namespaced value
+Pass No children, namespaced value
Pass Single child, no value
Pass Single child, empty value
Pass Single child, value
-Fail Single child, namespaced value
+Pass Single child, namespaced value
Pass Two children, no value
Pass Two children, empty value
Pass Two children, value
-Fail Two children, namespaced value
\ No newline at end of file
+Pass Two children, namespaced value
\ No newline at end of file