|
@@ -2445,16 +2445,9 @@ static void collect_attribute_values_of_an_inheritance_stack(SourceGenerator& fu
|
|
|
|
|
|
if (attribute.extended_attributes.contains("Reflect")) {
|
|
|
if (attribute.type->name() != "boolean") {
|
|
|
- // FIXME: This should be calling Element::get_attribute_value: https://dom.spec.whatwg.org/#concept-element-attributes-get-value
|
|
|
- if (attribute.type->is_nullable()) {
|
|
|
- attribute_generator.append(R"~~~(
|
|
|
- auto @attribute.return_value_name@ = impl->attribute(HTML::AttributeNames::@attribute.reflect_name@);
|
|
|
-)~~~");
|
|
|
- } else {
|
|
|
- attribute_generator.append(R"~~~(
|
|
|
- auto @attribute.return_value_name@ = impl->attribute(HTML::AttributeNames::@attribute.reflect_name@).value_or(String {});
|
|
|
+ attribute_generator.append(R"~~~(
|
|
|
+ auto @attribute.return_value_name@ = impl->get_attribute_value(HTML::AttributeNames::@attribute.reflect_name@);
|
|
|
)~~~");
|
|
|
- }
|
|
|
} else {
|
|
|
attribute_generator.append(R"~~~(
|
|
|
auto @attribute.return_value_name@ = impl->has_attribute(HTML::AttributeNames::@attribute.reflect_name@);
|
|
@@ -3044,16 +3037,9 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.getter_callback@)
|
|
|
// FIXME: 7. If contentAttributeValue corresponds to a state of attributeDefinition with no associated keyword value, then return null.
|
|
|
}
|
|
|
} else if (attribute.type->name() != "boolean") {
|
|
|
- // FIXME: This should be calling Element::get_attribute_value: https://dom.spec.whatwg.org/#concept-element-attributes-get-value
|
|
|
- if (attribute.type->is_nullable()) {
|
|
|
- attribute_generator.append(R"~~~(
|
|
|
- auto retval = impl->attribute(HTML::AttributeNames::@attribute.reflect_name@);
|
|
|
-)~~~");
|
|
|
- } else {
|
|
|
- attribute_generator.append(R"~~~(
|
|
|
- auto retval = impl->attribute(HTML::AttributeNames::@attribute.reflect_name@).value_or(String {});
|
|
|
+ attribute_generator.append(R"~~~(
|
|
|
+ auto retval = impl->get_attribute_value(HTML::AttributeNames::@attribute.reflect_name@);
|
|
|
)~~~");
|
|
|
- }
|
|
|
} else {
|
|
|
attribute_generator.append(R"~~~(
|
|
|
auto retval = impl->has_attribute(HTML::AttributeNames::@attribute.reflect_name@);
|