mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +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
|
@ -51,20 +51,17 @@ void HTMLScriptElement::attribute_changed(DeprecatedFlyString const& name, Depre
|
|||
{
|
||||
Base::attribute_changed(name, value);
|
||||
|
||||
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::referrerpolicy)
|
||||
m_referrer_policy = ReferrerPolicy::from_string(value);
|
||||
}
|
||||
|
||||
void HTMLScriptElement::did_remove_attribute(DeprecatedFlyString const& name)
|
||||
{
|
||||
Base::did_remove_attribute(name);
|
||||
|
||||
if (name == HTML::AttributeNames::crossorigin)
|
||||
m_crossorigin = cors_setting_attribute_from_keyword({});
|
||||
else if (name == HTML::AttributeNames::referrerpolicy)
|
||||
m_referrer_policy.clear();
|
||||
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::referrerpolicy) {
|
||||
if (value.is_null())
|
||||
m_referrer_policy.clear();
|
||||
else
|
||||
m_referrer_policy = ReferrerPolicy::from_string(value);
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLScriptElement::begin_delaying_document_load_event(DOM::Document& document)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue