summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-01-18 16:58:12 +0000
committerAndreas Kling <kling@serenityos.org>2022-01-20 00:04:10 +0100
commitc8409cd58d356ded914b961cc5744999a927e1be (patch)
treec7db95e1278f962032625c589f88c2965a583e23
parente60d51b8eb8e9bb2265170a63ee24297a6874cb8 (diff)
downloadserenity-c8409cd58d356ded914b961cc5744999a927e1be.zip
LibWeb: Remove Node::m_font_size
This was only ever used in order to set the m_font_size for another Node, so it can just go. :^)
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.cpp11
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.h11
2 files changed, 0 insertions, 22 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp
index b94e987521..ac773ccd02 100644
--- a/Userland/Libraries/LibWeb/Layout/Node.cpp
+++ b/Userland/Libraries/LibWeb/Layout/Node.cpp
@@ -206,16 +206,6 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
m_line_height = specified_style.line_height(*this);
{
- constexpr int default_font_size = 10;
- auto parent_font_size = parent() == nullptr ? default_font_size : parent()->font_size();
- auto length = specified_style.length_or_fallback(CSS::PropertyID::FontSize, CSS::Length(default_font_size, CSS::Length::Type::Px));
- // FIXME: em sizes return 0 here, for some reason
- m_font_size = length.resolved_or_zero(*this, parent_font_size).to_px(*this);
- if (m_font_size == 0)
- m_font_size = default_font_size;
- }
-
- {
auto attachments = specified_style.property(CSS::PropertyID::BackgroundAttachment);
auto clips = specified_style.property(CSS::PropertyID::BackgroundClip);
auto images = specified_style.property(CSS::PropertyID::BackgroundImage);
@@ -539,7 +529,6 @@ NonnullRefPtr<NodeWithStyle> NodeWithStyle::create_anonymous_wrapper() const
{
auto wrapper = adopt_ref(*new BlockContainer(const_cast<DOM::Document&>(document()), nullptr, m_computed_values.clone_inherited_values()));
wrapper->m_font = m_font;
- wrapper->m_font_size = m_font_size;
wrapper->m_line_height = m_line_height;
return wrapper;
}
diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h
index 07bf27a54f..3a6a90a009 100644
--- a/Userland/Libraries/LibWeb/Layout/Node.h
+++ b/Userland/Libraries/LibWeb/Layout/Node.h
@@ -146,8 +146,6 @@ public:
Gfx::FloatPoint box_type_agnostic_position() const;
- float font_size() const;
-
enum class SelectionState {
None, // No selection
Start, // Selection starts in this Node
@@ -204,7 +202,6 @@ public:
const Gfx::Font& font() const { return *m_font; }
float line_height() const { return m_line_height; }
- float font_size() const { return m_font_size; }
Vector<CSS::BackgroundLayerData> const& background_layers() const { return computed_values().background_layers(); }
const CSS::ImageStyleValue* list_style_image() const { return m_list_style_image; }
@@ -221,7 +218,6 @@ private:
CSS::ComputedValues m_computed_values;
RefPtr<Gfx::Font> m_font;
float m_line_height { 0 };
- float m_font_size { 0 };
RefPtr<CSS::ImageStyleValue> m_list_style_image;
bool m_has_definite_height { false };
@@ -255,13 +251,6 @@ inline const Gfx::Font& Node::font() const
return parent()->font();
}
-inline float Node::font_size() const
-{
- if (m_has_style)
- return static_cast<const NodeWithStyle*>(this)->font_size();
- return parent()->font_size();
-}
-
inline const CSS::ImmutableComputedValues& Node::computed_values() const
{
if (m_has_style)