mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Rename CSS::FontFace to CSS::ParsedFontFace
This implementation detail of CSSFontFaceRule is hogging the name of a Web API from CSS Font Loading Module Level 3.
This commit is contained in:
parent
3f113e728f
commit
3a5eabc43b
Notes:
sideshowbarker
2024-07-16 21:42:29 +09:00
Author: https://github.com/ADKaster
Commit: 3a5eabc43b
Pull-request: https://github.com/SerenityOS/serenity/pull/24255
Issue: https://github.com/SerenityOS/serenity/issues/22014
8 changed files with 23 additions and 23 deletions
42
Userland/Libraries/LibWeb/CSS/ParsedFontFace.h
Normal file
42
Userland/Libraries/LibWeb/CSS/ParsedFontFace.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <LibGfx/Font/UnicodeRange.h>
|
||||
#include <LibURL/URL.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
class ParsedFontFace {
|
||||
public:
|
||||
struct Source {
|
||||
Variant<String, URL::URL> local_or_url;
|
||||
// FIXME: Do we need to keep this around, or is it only needed to discard unwanted formats during parsing?
|
||||
Optional<FlyString> format;
|
||||
};
|
||||
|
||||
ParsedFontFace(FlyString font_family, Optional<int> weight, Optional<int> slope, Vector<Source> sources, Vector<Gfx::UnicodeRange> unicode_ranges);
|
||||
~ParsedFontFace() = default;
|
||||
|
||||
FlyString font_family() const { return m_font_family; }
|
||||
Optional<int> weight() const { return m_weight; }
|
||||
Optional<int> slope() const { return m_slope; }
|
||||
Vector<Source> const& sources() const { return m_sources; }
|
||||
Vector<Gfx::UnicodeRange> const& unicode_ranges() const { return m_unicode_ranges; }
|
||||
// FIXME: font-stretch, font-feature-settings
|
||||
|
||||
private:
|
||||
FlyString m_font_family;
|
||||
Optional<int> m_weight { 0 };
|
||||
Optional<int> m_slope { 0 };
|
||||
Vector<Source> m_sources;
|
||||
Vector<Gfx::UnicodeRange> m_unicode_ranges;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue