mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
LibWeb: Consistently use the EmptyString state of ReferrerPolicy
We previously used an empty optional to denote that a ReferrerPolicy is in the default empty string state. However, later additions added an explicit EmptyString state. This patch moves all users to the explicit state, and stops using `Optional<ReferrerPolicy>` everywhere except for when an option not being passed from JavaScript has meaning.
This commit is contained in:
parent
637f2f2ed6
commit
c79bac70f4
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/ADKaster
Commit: c79bac70f4
Pull-request: https://github.com/SerenityOS/serenity/pull/23476
12 changed files with 23 additions and 24 deletions
|
@ -54,10 +54,7 @@ void HTMLScriptElement::attribute_changed(FlyString const& name, Optional<String
|
|||
if (name == HTML::AttributeNames::crossorigin) {
|
||||
m_crossorigin = cors_setting_attribute_from_keyword(value);
|
||||
} else if (name == HTML::AttributeNames::referrerpolicy) {
|
||||
if (!value.has_value())
|
||||
m_referrer_policy.clear();
|
||||
else
|
||||
m_referrer_policy = ReferrerPolicy::from_string(*value);
|
||||
m_referrer_policy = ReferrerPolicy::from_string(value.value_or(""_string)).value_or(ReferrerPolicy::ReferrerPolicy::EmptyString);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue