1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibWeb: Port Layout::TextNode from DeprecatedString

This commit is contained in:
Shannon Booth 2023-11-21 10:56:29 +13:00 committed by Tim Flynn
parent 6b32a1f18f
commit 56d10bf198
Notes: sideshowbarker 2024-07-16 23:13:25 +09:00
9 changed files with 37 additions and 35 deletions

View file

@ -234,13 +234,13 @@ ErrorOr<void> TreeBuilder::create_pseudo_element_if_needed(DOM::Element& element
static bool is_ignorable_whitespace(Layout::Node const& node)
{
if (node.is_text_node() && static_cast<TextNode const&>(node).text_for_rendering().is_whitespace())
if (node.is_text_node() && static_cast<TextNode const&>(node).text_for_rendering().bytes_as_string_view().is_whitespace())
return true;
if (node.is_anonymous() && node.is_block_container() && static_cast<BlockContainer const&>(node).children_are_inline()) {
bool contains_only_white_space = true;
node.for_each_in_inclusive_subtree_of_type<TextNode>([&contains_only_white_space](auto& text_node) {
if (!text_node.text_for_rendering().is_whitespace()) {
if (!text_node.text_for_rendering().bytes_as_string_view().is_whitespace()) {
contains_only_white_space = false;
return IterationDecision::Break;
}