Browse Source

LibWeb: Remove unused Layout::TextNode::ChunkIterator::m_layout_mode

Andreas Kling 2 years ago
parent
commit
063d6cab8b

+ 1 - 1
Userland/Libraries/LibWeb/Layout/InlineLevelIterator.cpp

@@ -261,7 +261,7 @@ void InlineLevelIterator::enter_text_node(Layout::TextNode const& text_node)
         .do_respect_linebreaks = do_respect_linebreaks,
         .is_first_chunk = true,
         .is_last_chunk = false,
-        .chunk_iterator = TextNode::ChunkIterator { text_node.text_for_rendering(), m_layout_mode, do_wrap_lines, do_respect_linebreaks },
+        .chunk_iterator = TextNode::ChunkIterator { text_node.text_for_rendering(), do_wrap_lines, do_respect_linebreaks },
     };
     m_text_node_context->next_chunk = m_text_node_context->chunk_iterator.next();
 }

+ 2 - 3
Userland/Libraries/LibWeb/Layout/TextNode.cpp

@@ -85,9 +85,8 @@ void TextNode::compute_text_for_rendering(bool collapse)
     m_text_for_rendering = builder.to_string();
 }
 
-TextNode::ChunkIterator::ChunkIterator(StringView text, LayoutMode layout_mode, bool wrap_lines, bool respect_linebreaks)
-    : m_layout_mode(layout_mode)
-    , m_wrap_lines(wrap_lines)
+TextNode::ChunkIterator::ChunkIterator(StringView text, bool wrap_lines, bool respect_linebreaks)
+    : m_wrap_lines(wrap_lines)
     , m_respect_linebreaks(respect_linebreaks)
     , m_utf8_view(text)
     , m_iterator(m_utf8_view.begin())

+ 1 - 2
Userland/Libraries/LibWeb/Layout/TextNode.h

@@ -33,13 +33,12 @@ public:
 
     class ChunkIterator {
     public:
-        ChunkIterator(StringView text, LayoutMode, bool wrap_lines, bool respect_linebreaks);
+        ChunkIterator(StringView text, bool wrap_lines, bool respect_linebreaks);
         Optional<Chunk> next();
 
     private:
         Optional<Chunk> try_commit_chunk(Utf8View::Iterator const& start, Utf8View::Iterator const& end, bool has_breaking_newline) const;
 
-        const LayoutMode m_layout_mode;
         bool const m_wrap_lines;
         bool const m_respect_linebreaks;
         Utf8View m_utf8_view;