mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
LibHTML: Fix bug in removal of trailing whitespace from line boxes
This code was using the text from the DOM as a reference for how much whitespace to remove from the end of a line box. Since the DOM may contain uncollapsed whitespace, it would sometimes be out of sync with the collapsed text used by the rest of the layout system.
This commit is contained in:
parent
1fe2cca439
commit
5a04472470
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ StringView LineBoxFragment::text() const
|
|||
{
|
||||
if (!is<LayoutText>(layout_node()))
|
||||
return {};
|
||||
return to<LayoutText>(layout_node()).node().data().substring_view(m_start, m_length);
|
||||
return to<LayoutText>(layout_node()).text_for_rendering().substring_view(m_start, m_length);
|
||||
}
|
||||
|
||||
int LineBoxFragment::text_index_at(float x) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue