mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +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
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/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 {
|
||||
.type = Item::Type::Text,
|
||||
.node = &text_node,
|
||||
.offset_in_node = chunk.start,
|
||||
.length_in_node = chunk.length,
|
||||
.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);
|
||||
|
|
Loading…
Reference in a new issue