mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibWeb: Make painting order more spec-compliant
Now our painting order inside stacking contexts is closer to the algorithm specified by CSS 2.1 (see section 9.9 and Appendix E)
This commit is contained in:
parent
33af7075e7
commit
d2b6148787
8 changed files with 89 additions and 43 deletions
|
@ -67,6 +67,18 @@ const BlockBox* Node::containing_block() const
|
|||
return nearest_block_ancestor();
|
||||
}
|
||||
|
||||
bool Node::establishes_stacking_context() const
|
||||
{
|
||||
if (!has_style())
|
||||
return false;
|
||||
if (dom_node() == document().root())
|
||||
return true;
|
||||
auto position = computed_values().position();
|
||||
if (position == CSS::Position::Absolute || position == CSS::Position::Relative || position == CSS::Position::Fixed || position == CSS::Position::Sticky)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Node::paint(PaintContext& context, PaintPhase phase)
|
||||
{
|
||||
if (!is_visible())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue