mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
LibWeb: Move font list from NodeWithStyle to ComputedValues
Same here, no need for this to live in NodeWithStyle. Inheritance behavior for free in ComputedValues.
This commit is contained in:
parent
c82d517447
commit
bc3a16396e
5 changed files with 7 additions and 33 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <LibGfx/FontCascadeList.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
#include <LibWeb/CSS/BackdropFilter.h>
|
||||
#include <LibWeb/CSS/CalculatedOr.h>
|
||||
|
@ -388,6 +389,7 @@ public:
|
|||
Vector<CSS::Transformation> const& transformations() const { return m_noninherited.transformations; }
|
||||
CSS::TransformOrigin const& transform_origin() const { return m_noninherited.transform_origin; }
|
||||
|
||||
Gfx::FontCascadeList const& font_list() const { return *m_inherited.font_list; }
|
||||
CSSPixels font_size() const { return m_inherited.font_size; }
|
||||
int font_weight() const { return m_inherited.font_weight; }
|
||||
CSS::FontVariant font_variant() const { return m_inherited.font_variant; }
|
||||
|
@ -416,6 +418,7 @@ public:
|
|||
|
||||
protected:
|
||||
struct {
|
||||
RefPtr<Gfx::FontCascadeList> font_list {};
|
||||
CSSPixels font_size { InitialValues::font_size() };
|
||||
int font_weight { InitialValues::font_weight() };
|
||||
CSS::FontVariant font_variant { InitialValues::font_variant() };
|
||||
|
@ -547,6 +550,7 @@ public:
|
|||
}
|
||||
|
||||
void set_aspect_ratio(AspectRatio aspect_ratio) { m_noninherited.aspect_ratio = aspect_ratio; }
|
||||
void set_font_list(NonnullRefPtr<Gfx::FontCascadeList> font_list) { m_inherited.font_list = move(font_list); }
|
||||
void set_font_size(CSSPixels font_size) { m_inherited.font_size = font_size; }
|
||||
void set_font_weight(int font_weight) { m_inherited.font_weight = font_weight; }
|
||||
void set_font_variant(CSS::FontVariant font_variant) { m_inherited.font_variant = font_variant; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue