LibWeb/CSS: Make fetch_a_style_resource() take URLs not strings

The spec has this parameter as "a url or `<url>`", so let's match that.
This commit is contained in:
Sam Atkins 2025-04-10 10:26:22 +01:00
commit f4cfdd704b
Notes: github-actions[bot] 2025-04-15 09:31:11 +00:00
3 changed files with 13 additions and 7 deletions

View file

@ -1,12 +1,13 @@
/*
* Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
* Copyright (c) 2024-2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/String.h>
#include <LibURL/URL.h>
#include <LibWeb/CSS/URL.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Requests.h>
@ -17,7 +18,9 @@ enum class CorsMode {
Cors,
};
using StyleResourceURL = Variant<::URL::URL, CSS::URL>;
// https://drafts.csswg.org/css-values-4/#fetch-a-style-resource
void fetch_a_style_resource(String const& url, CSSStyleSheet const&, Fetch::Infrastructure::Request::Destination, CorsMode, Fetch::Infrastructure::FetchAlgorithms::ProcessResponseConsumeBodyFunction process_response);
void fetch_a_style_resource(StyleResourceURL const& url, CSSStyleSheet const&, Fetch::Infrastructure::Request::Destination, CorsMode, Fetch::Infrastructure::FetchAlgorithms::ProcessResponseConsumeBodyFunction process_response);
}