mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
LibWeb: Don't treat content: ""
as collapsible whitespace
I couldn't find anything in specs about this, but it seems to be roughly consistent with other engines.
This commit is contained in:
parent
4ddfc3a6db
commit
c70801ddbc
1 changed files with 4 additions and 1 deletions
|
@ -152,13 +152,16 @@ Optional<InlineLevelIterator::Item> InlineLevelIterator::next(float available_wi
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: We never consider `content: ""` to be collapsible whitespace.
|
||||||
|
bool is_generated_empty_string = text_node.is_generated() && chunk.length == 0;
|
||||||
|
|
||||||
Item item {
|
Item item {
|
||||||
.type = Item::Type::Text,
|
.type = Item::Type::Text,
|
||||||
.node = &text_node,
|
.node = &text_node,
|
||||||
.offset_in_node = chunk.start,
|
.offset_in_node = chunk.start,
|
||||||
.length_in_node = chunk.length,
|
.length_in_node = chunk.length,
|
||||||
.width = chunk_width,
|
.width = chunk_width,
|
||||||
.is_collapsible_whitespace = m_text_node_context->do_collapse && chunk.is_all_whitespace,
|
.is_collapsible_whitespace = m_text_node_context->do_collapse && chunk.is_all_whitespace && !is_generated_empty_string,
|
||||||
};
|
};
|
||||||
|
|
||||||
add_extra_box_model_metrics_to_item(item, m_text_node_context->is_first_chunk, m_text_node_context->is_last_chunk);
|
add_extra_box_model_metrics_to_item(item, m_text_node_context->is_first_chunk, m_text_node_context->is_last_chunk);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue