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:
parent
6b32a1f18f
commit
56d10bf198
Notes:
sideshowbarker
2024-07-16 23:13:25 +09:00
Author: https://github.com/shannonbooth
Commit: 56d10bf198
Pull-request: https://github.com/SerenityOS/serenity/pull/22057
Reviewed-by: https://github.com/trflynn89
9 changed files with 37 additions and 35 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue