mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Improve support for white-space CSS property (#2348)
Add reasonable support for all values of white-space CSS property. Values of the property are translated into a 3-tuple of rules: do_collapse: whether whitespace is to be collapsed do_wrap_lines: whether to wrap on word boundaries when lines get too long do_wrap_breaks: whether to wrap on linebreaks The previously separate handling of per-line splitting and per-word splitting have been unified. The Word structure is now a more general Chunk, which represents different amounts of text depending on splitting rules.
This commit is contained in:
parent
3f2158bbfe
commit
58480a510f
Notes:
sideshowbarker
2024-07-19 06:11:31 +09:00
Author: https://github.com/jgbyrne 🔰
Commit: 58480a510f
Pull-request: https://github.com/SerenityOS/serenity/pull/2348
2 changed files with 114 additions and 98 deletions
|
@ -53,10 +53,10 @@ public:
|
|||
const StyleProperties& style() const { return parent()->style(); }
|
||||
|
||||
private:
|
||||
void split_preformatted_into_lines(LayoutBlock& container);
|
||||
void split_into_lines_by_rules(LayoutBlock& container, bool do_collapse, bool do_wrap_lines, bool do_wrap_breaks);
|
||||
|
||||
template<typename Callback>
|
||||
void for_each_word(Callback) const;
|
||||
void for_each_chunk(Callback, bool do_wrap_lines, bool do_wrap_breaks) const;
|
||||
|
||||
String m_text_for_rendering;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue