LibWeb/CSS: Const-correct ComputedProperties::set_computed_font_list()
Some checks are pending
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This shouldn't be const, and that means the two members don't have to be
mutable.
This commit is contained in:
Sam Atkins 2025-04-09 12:24:11 +01:00 committed by Alexander Kalenik
parent db8c443392
commit 86be8abfbf
Notes: github-actions[bot] 2025-04-09 13:33:00 +00:00

View file

@ -198,7 +198,7 @@ public:
return *m_first_available_computed_font;
}
void set_computed_font_list(NonnullRefPtr<Gfx::FontCascadeList> font_list) const
void set_computed_font_list(NonnullRefPtr<Gfx::FontCascadeList> font_list)
{
m_font_list = move(font_list);
// https://drafts.csswg.org/css-fonts/#first-available-font
@ -251,8 +251,8 @@ private:
HashMap<PropertyID, NonnullRefPtr<CSSStyleValue const>> m_animated_property_values;
int m_math_depth { InitialValues::math_depth() };
mutable RefPtr<Gfx::FontCascadeList> m_font_list;
mutable RefPtr<Gfx::Font> m_first_available_computed_font;
RefPtr<Gfx::FontCascadeList> m_font_list;
RefPtr<Gfx::Font> m_first_available_computed_font;
Optional<CSSPixels> m_line_height;