LibWeb: Remove unused code

The LineBoxFragment::Type enum was used earlier in the inline layouting,
but in the current algorithm there is a single type of LineBoxFragment.
This commit is contained in:
Sebastian Zaha 2023-07-17 17:12:54 +02:00 committed by Andreas Kling
parent 3fd870a429
commit a74c56bc1b
Notes: sideshowbarker 2024-07-18 08:59:31 +09:00
3 changed files with 4 additions and 13 deletions

View File

@ -15,7 +15,7 @@
namespace Web::Layout {
void LineBox::add_fragment(Node const& layout_node, int start, int length, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin, CSSPixels content_width, CSSPixels content_height, CSSPixels border_box_top, CSSPixels border_box_bottom, LineBoxFragment::Type fragment_type)
void LineBox::add_fragment(Node const& layout_node, int start, int length, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin, CSSPixels content_width, CSSPixels content_height, CSSPixels border_box_top, CSSPixels border_box_bottom)
{
bool text_align_is_justify = layout_node.computed_values().text_align() == CSS::TextAlign::Justify;
if (!text_align_is_justify && !m_fragments.is_empty() && &m_fragments.last().layout_node() == &layout_node) {
@ -26,7 +26,7 @@ void LineBox::add_fragment(Node const& layout_node, int start, int length, CSSPi
} else {
CSSPixels x_offset = leading_margin + leading_size + m_width;
CSSPixels y_offset = 0.0f;
m_fragments.append(LineBoxFragment { layout_node, start, length, CSSPixelPoint(x_offset, y_offset), CSSPixelSize(content_width, content_height), border_box_top, border_box_bottom, fragment_type });
m_fragments.append(LineBoxFragment { layout_node, start, length, CSSPixelPoint(x_offset, y_offset), CSSPixelSize(content_width, content_height), border_box_top, border_box_bottom });
}
m_width += leading_margin + leading_size + content_width + trailing_size + trailing_margin;
}

View File

@ -20,7 +20,7 @@ public:
CSSPixels bottom() const { return m_bottom; }
CSSPixels baseline() const { return m_baseline; }
void add_fragment(Node const& layout_node, int start, int length, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin, CSSPixels content_width, CSSPixels content_height, CSSPixels border_box_top, CSSPixels border_box_bottom, LineBoxFragment::Type = LineBoxFragment::Type::Normal);
void add_fragment(Node const& layout_node, int start, int length, CSSPixels leading_size, CSSPixels trailing_size, CSSPixels leading_margin, CSSPixels trailing_margin, CSSPixels content_width, CSSPixels content_height, CSSPixels border_box_top, CSSPixels border_box_bottom);
Vector<LineBoxFragment> const& fragments() const { return m_fragments; }
Vector<LineBoxFragment>& fragments() { return m_fragments; }

View File

@ -17,13 +17,7 @@ class LineBoxFragment {
friend class LineBox;
public:
enum class Type {
Normal,
Leading,
Trailing,
};
LineBoxFragment(Node const& layout_node, int start, int length, CSSPixelPoint offset, CSSPixelSize size, CSSPixels border_box_top, CSSPixels border_box_bottom, Type type)
LineBoxFragment(Node const& layout_node, int start, int length, CSSPixelPoint offset, CSSPixelSize size, CSSPixels border_box_top, CSSPixels border_box_bottom)
: m_layout_node(layout_node)
, m_start(start)
, m_length(length)
@ -31,7 +25,6 @@ public:
, m_size(size)
, m_border_box_top(border_box_top)
, m_border_box_bottom(border_box_bottom)
, m_type(type)
{
}
@ -39,7 +32,6 @@ public:
int start() const { return m_start; }
int length() const { return m_length; }
CSSPixelRect const absolute_rect() const;
Type type() const { return m_type; }
CSSPixelPoint offset() const
{
@ -88,7 +80,6 @@ private:
CSSPixels m_border_box_top { 0 };
CSSPixels m_border_box_bottom { 0 };
CSSPixels m_baseline { 0 };
Type m_type { Type::Normal };
};
}