mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 01:56:38 +00:00
LibWeb: Consider empty fragments the same as whitespace in LineBox
When computing whether whitespace should be collapsed or not, we have to consider empty fragments, since <br> will produce an empty fragment to force a line break. LineBox::is_empty_or_ends_in_whitespace() is amended to look at the length of the last fragment, and return true if it is 0.
This commit is contained in:
parent
f0281ec19d
commit
d79ab32850
Notes:
sideshowbarker
2024-07-18 02:49:26 +09:00
Author: https://github.com/dburkart 🔰
Commit: d79ab32850
Pull-request: https://github.com/SerenityOS/serenity/pull/10434
1 changed files with 2 additions and 0 deletions
|
@ -61,6 +61,8 @@ bool LineBox::is_empty_or_ends_in_whitespace() const
|
||||||
{
|
{
|
||||||
if (m_fragments.is_empty())
|
if (m_fragments.is_empty())
|
||||||
return true;
|
return true;
|
||||||
|
if (m_fragments.last().length() == 0)
|
||||||
|
return true;
|
||||||
return m_fragments.last().ends_in_whitespace();
|
return m_fragments.last().ends_in_whitespace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue