LibWeb: Rename PaintableFragment::m_start and ::m_length

Make it extra clear that we're dealing with byte offsets here. No
functional changes.
This commit is contained in:
Jelle Raaijmakers 2025-06-12 14:49:47 +02:00 committed by Jelle Raaijmakers
commit 7beecaa43d
Notes: github-actions[bot] 2025-06-13 13:09:41 +00:00
4 changed files with 26 additions and 26 deletions

View file

@ -386,15 +386,15 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
color_off,
fragment.layout_node().class_name());
builder.appendff("start: {}, length: {}, rect: {} baseline: {}\n",
fragment.start(),
fragment.length(),
fragment.start_byte_offset(),
fragment.length_in_bytes(),
fragment.absolute_rect(),
fragment.baseline());
if (is<Layout::TextNode>(fragment.layout_node())) {
for (size_t i = 0; i < indent; ++i)
builder.append(" "sv);
auto const& layout_text = static_cast<Layout::TextNode const&>(fragment.layout_node());
auto fragment_text = MUST(layout_text.text_for_rendering().substring_from_byte_offset(fragment.start(), fragment.length()));
auto fragment_text = MUST(layout_text.text_for_rendering().substring_from_byte_offset(fragment.start_byte_offset(), fragment.length_in_bytes()));
builder.appendff(" \"{}\"\n", fragment_text);
}
};