mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +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
Notes:
sideshowbarker
2024-07-17 02:55:44 +09:00
Author: https://github.com/awesomekling
Commit: 21260ea2ef
Pull-request: https://github.com/SerenityOS/serenity/pull/19772
18 changed files with 86 additions and 152 deletions
|
@ -80,7 +80,11 @@ void HTMLImageElement::attribute_changed(DeprecatedFlyString const& name, Deprec
|
|||
HTMLElement::attribute_changed(name, value);
|
||||
|
||||
if (name == HTML::AttributeNames::crossorigin) {
|
||||
m_cors_setting = cors_setting_attribute_from_keyword(String::from_deprecated_string(value).release_value_but_fixme_should_propagate_errors());
|
||||
if (value.is_null()) {
|
||||
m_cors_setting = CORSSettingAttribute::NoCORS;
|
||||
} else {
|
||||
m_cors_setting = cors_setting_attribute_from_keyword(String::from_deprecated_string(value).release_value_but_fixme_should_propagate_errors());
|
||||
}
|
||||
}
|
||||
|
||||
if (name.is_one_of(HTML::AttributeNames::src, HTML::AttributeNames::srcset)) {
|
||||
|
@ -93,15 +97,6 @@ void HTMLImageElement::attribute_changed(DeprecatedFlyString const& name, Deprec
|
|||
}
|
||||
}
|
||||
|
||||
void HTMLImageElement::did_remove_attribute(DeprecatedFlyString const& name)
|
||||
{
|
||||
Base::did_remove_attribute(name);
|
||||
|
||||
if (name == HTML::AttributeNames::crossorigin) {
|
||||
m_cors_setting = CORSSettingAttribute::NoCORS;
|
||||
}
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> HTMLImageElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||
{
|
||||
return heap().allocate_without_realm<Layout::ImageBox>(document(), *this, move(style), *this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue