1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibWeb: Make Node::root return a reference

The root of a node can never be null, as "the root of an object is
itself, if its parent is null, or else it is the root of its parent."

https://dom.spec.whatwg.org/#concept-tree-root
This commit is contained in:
Luke Wilde 2021-09-02 19:27:42 +01:00 committed by Andreas Kling
parent 7f46022e66
commit f7f37eaa0f
5 changed files with 24 additions and 20 deletions

View file

@ -72,7 +72,7 @@ bool Node::establishes_stacking_context() const
{
if (!has_style())
return false;
if (dom_node() == document().root())
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)