mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 00:25:07 +00:00
LibWeb: Merge did_remove_attribute() into attribute_changed()
Instead of having two virtuals for attribute change notifications, there is now only one. When the attribute is removed, the value is null.
This commit is contained in:
parent
5a74486b59
commit
21260ea2ef
18 changed files with 86 additions and 152 deletions
|
@ -88,20 +88,16 @@ void HTMLMediaElement::attribute_changed(DeprecatedFlyString const& name, Deprec
|
|||
{
|
||||
Base::attribute_changed(name, value);
|
||||
|
||||
if (name == HTML::AttributeNames::src)
|
||||
if (name == HTML::AttributeNames::src) {
|
||||
load_element().release_value_but_fixme_should_propagate_errors();
|
||||
else if (name == HTML::AttributeNames::crossorigin)
|
||||
m_crossorigin = cors_setting_attribute_from_keyword(String::from_deprecated_string(value).release_value_but_fixme_should_propagate_errors());
|
||||
else if (name == HTML::AttributeNames::muted)
|
||||
} else if (name == HTML::AttributeNames::crossorigin) {
|
||||
if (value.is_null())
|
||||
m_crossorigin = cors_setting_attribute_from_keyword({});
|
||||
else
|
||||
m_crossorigin = cors_setting_attribute_from_keyword(String::from_deprecated_string(value).release_value_but_fixme_should_propagate_errors());
|
||||
} else if (name == HTML::AttributeNames::muted) {
|
||||
set_muted(true);
|
||||
}
|
||||
|
||||
void HTMLMediaElement::did_remove_attribute(DeprecatedFlyString const& name)
|
||||
{
|
||||
Base::did_remove_attribute(name);
|
||||
|
||||
if (name == HTML::AttributeNames::crossorigin)
|
||||
m_crossorigin = cors_setting_attribute_from_keyword({});
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:media-element-83
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue