mirror of
https://github.com/RGBCube/serenity
synced 2025-07-05 12:47:36 +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
12 changed files with 23 additions and 24 deletions
|
@ -236,7 +236,7 @@ WebIDL::ExceptionOr<Optional<JS::NonnullGCPtr<PendingResponse>>> main_fetch(JS::
|
|||
|
||||
// 8. If request’s referrer policy is the empty string, then set request’s referrer policy to request’s policy
|
||||
// container’s referrer policy.
|
||||
if (!request->referrer_policy().has_value()) {
|
||||
if (request->referrer_policy() == ReferrerPolicy::ReferrerPolicy::EmptyString) {
|
||||
VERIFY(request->policy_container().has<HTML::PolicyContainer>());
|
||||
request->set_referrer_policy(request->policy_container().get<HTML::PolicyContainer>().referrer_policy);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue