mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-28 04:08:08 +00:00
AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of the system, as LibCore depends on LibURL. This change has two main benefits: * Moving AK back more towards being an agnostic library that can be used between the kernel and userspace. URL has never really fit that description - and is not used in the kernel. * URL _should_ depend on LibUnicode, as it needs punnycode support. However, it's not really possible to do this inside of AK as it can't depend on any external library. This change brings us a little closer to being able to do that, but unfortunately we aren't there quite yet, as the code generators depend on LibCore.
This commit is contained in:
@@ -102,7 +102,7 @@ StyleComputer::~StyleComputer() = default;
|
||||
|
||||
class StyleComputer::FontLoader : public ResourceClient {
|
||||
public:
|
||||
explicit FontLoader(StyleComputer& style_computer, FlyString family_name, Vector<Gfx::UnicodeRange> unicode_ranges, Vector<URL> urls)
|
||||
explicit FontLoader(StyleComputer& style_computer, FlyString family_name, Vector<Gfx::UnicodeRange> unicode_ranges, Vector<URL::URL> urls)
|
||||
: m_style_computer(style_computer)
|
||||
, m_family_name(move(family_name))
|
||||
, m_unicode_ranges(move(unicode_ranges))
|
||||
@@ -187,7 +187,7 @@ private:
|
||||
FlyString m_family_name;
|
||||
Vector<Gfx::UnicodeRange> m_unicode_ranges;
|
||||
RefPtr<Gfx::VectorFont> m_vector_font;
|
||||
Vector<URL> m_urls;
|
||||
Vector<URL::URL> m_urls;
|
||||
};
|
||||
|
||||
struct StyleComputer::MatchingFontCandidate {
|
||||
@@ -2494,11 +2494,11 @@ void StyleComputer::load_fonts_from_sheet(CSSStyleSheet const& sheet)
|
||||
.slope = font_face.slope().value_or(0),
|
||||
};
|
||||
|
||||
Vector<URL> urls;
|
||||
Vector<URL::URL> urls;
|
||||
for (auto& source : font_face.sources()) {
|
||||
// FIXME: These should be loaded relative to the stylesheet URL instead of the document URL.
|
||||
if (source.local_or_url.has<URL>())
|
||||
urls.append(m_document->parse_url(MUST(source.local_or_url.get<URL>().to_string())));
|
||||
if (source.local_or_url.has<URL::URL>())
|
||||
urls.append(m_document->parse_url(MUST(source.local_or_url.get<URL::URL>().to_string())));
|
||||
// FIXME: Handle local()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user