mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:57:42 +00:00
LibWeb: Paint fragments contained by inline node as part of this node
Fragments contained by the inline node should be painted in the foreground phase for this node, instead of being painted as a part of the containing PaintableWithLines. This change implements that by marking all fragments contained by inline nodes so they can be skipped while painting the content of PaintableWithLines. This is an ugly way, and instead, we should make InlinePaintables own all fragments contained by them.
This commit is contained in:
parent
c5187c6bb3
commit
6c645f3a9f
6 changed files with 45 additions and 3 deletions
|
@ -460,6 +460,18 @@ void LayoutState::commit(Box& root)
|
|||
|
||||
resolve_border_radii();
|
||||
resolve_box_shadow_data();
|
||||
|
||||
for (auto& it : used_values_per_layout_node) {
|
||||
auto& used_values = *it.value;
|
||||
auto& node = const_cast<NodeWithStyle&>(used_values.node());
|
||||
auto* paintable = node.paintable();
|
||||
if (paintable && is<Painting::InlinePaintable>(*paintable)) {
|
||||
auto& inline_paintable = static_cast<Painting::InlinePaintable&>(*paintable);
|
||||
// FIXME: Marking fragments contained by inline node is a hack required to skip them while painting
|
||||
// PaintableWithLines content.
|
||||
inline_paintable.mark_contained_fragments();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutState::UsedValues::set_node(NodeWithStyle& node, UsedValues const* containing_block_used_values)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue