mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-09 16:42:19 +02:00
This patch completely reworks TextNode::compute_text_for_rendering(). It removes the unnecessary usage of Utf8View to find spaces in a String. Furthermore, it adds a couple fast return paths for common but trivial cases such as empty, single-character and whitespace-less strings. For the HTML spec bookmarks, around two thirds of all function calls (which amounts to around 10'000) use the fast paths and thus avoid allocating a StringBuilder just to build a copy of the already present String.
13 KiB
13 KiB