mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 18:28:57 +00:00
LibWeb: Make fragment start/length size_t
instead of int
These must always be unsigned. No functional changes.
This commit is contained in:
parent
b42c2c5e8f
commit
9126507dc6
Notes:
github-actions[bot]
2025-06-13 13:10:39 +00:00
Author: https://github.com/gmta
Commit: 9126507dc6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5067
Reviewed-by: https://github.com/tcl3
Reviewed-by: https://github.com/trflynn89
9 changed files with 19 additions and 22 deletions
|
@ -35,7 +35,7 @@ CSSPixels LineBox::bottom() const
|
|||
return m_bottom;
|
||||
}
|
||||
|
||||
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, RefPtr<Gfx::GlyphRun> glyph_run)
|
||||
void LineBox::add_fragment(Node const& layout_node, size_t start, size_t 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, RefPtr<Gfx::GlyphRun> glyph_run)
|
||||
{
|
||||
bool text_align_is_justify = layout_node.computed_values().text_align() == CSS::TextAlign::Justify;
|
||||
if (glyph_run && !text_align_is_justify && !m_fragments.is_empty() && &m_fragments.last().layout_node() == &layout_node && &m_fragments.last().m_glyph_run->font() == &glyph_run->font()) {
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
CSSPixels block_length() const { return m_block_length; }
|
||||
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, RefPtr<Gfx::GlyphRun> glyph_run = {});
|
||||
void add_fragment(Node const& layout_node, size_t start, size_t 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, RefPtr<Gfx::GlyphRun> glyph_run = {});
|
||||
|
||||
Vector<LineBoxFragment> const& fragments() const { return m_fragments; }
|
||||
Vector<LineBoxFragment>& fragments() { return m_fragments; }
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
LineBoxFragment::LineBoxFragment(Node const& layout_node, int start, int length, CSSPixels inline_offset, CSSPixels block_offset, CSSPixels inline_length, CSSPixels block_length, CSSPixels border_box_top, CSS::Direction direction, CSS::WritingMode writing_mode, RefPtr<Gfx::GlyphRun> glyph_run)
|
||||
LineBoxFragment::LineBoxFragment(Node const& layout_node, size_t start, size_t length, CSSPixels inline_offset, CSSPixels block_offset, CSSPixels inline_length, CSSPixels block_length, CSSPixels border_box_top, CSS::Direction direction, CSS::WritingMode writing_mode, RefPtr<Gfx::GlyphRun> glyph_run)
|
||||
: m_layout_node(layout_node)
|
||||
, m_start(start)
|
||||
, m_length(length)
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <LibGfx/Rect.h>
|
||||
#include <LibGfx/TextLayout.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/Painting/BorderRadiiData.h>
|
||||
#include <LibWeb/PixelUnits.h>
|
||||
|
||||
namespace Web::Layout {
|
||||
|
@ -19,11 +18,11 @@ class LineBoxFragment {
|
|||
friend class LineBox;
|
||||
|
||||
public:
|
||||
LineBoxFragment(Node const& layout_node, int start, int length, CSSPixels inline_offset, CSSPixels block_offset, CSSPixels inline_length, CSSPixels block_length, CSSPixels border_box_top, CSS::Direction, CSS::WritingMode, RefPtr<Gfx::GlyphRun>);
|
||||
LineBoxFragment(Node const& layout_node, size_t start, size_t length, CSSPixels inline_offset, CSSPixels block_offset, CSSPixels inline_length, CSSPixels block_length, CSSPixels border_box_top, CSS::Direction, CSS::WritingMode, RefPtr<Gfx::GlyphRun>);
|
||||
|
||||
Node const& layout_node() const { return m_layout_node; }
|
||||
int start() const { return m_start; }
|
||||
int length() const { return m_length; }
|
||||
size_t start() const { return m_start; }
|
||||
size_t length() const { return m_length; }
|
||||
|
||||
CSSPixelPoint offset() const;
|
||||
CSSPixels inline_offset() const { return m_inline_offset; }
|
||||
|
@ -61,8 +60,8 @@ private:
|
|||
void append_glyph_run_rtl(RefPtr<Gfx::GlyphRun> const&, CSSPixels run_width);
|
||||
|
||||
GC::Ref<Node const> m_layout_node;
|
||||
int m_start { 0 };
|
||||
int m_length { 0 };
|
||||
size_t m_start { 0 };
|
||||
size_t m_length { 0 };
|
||||
CSSPixels m_inline_offset;
|
||||
CSSPixels m_block_offset;
|
||||
CSSPixels m_inline_length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue