LibWeb: Clarify stacking context creation for viewport box
Explicitly check is_viewport() instead of looking at the corresponding DOM node. (The viewport has the DOM document as its DOM node, but that's not obvious from context here.)
This commit is contained in:
parent
8169b878f8
commit
8b177a6da5
Notes:
sideshowbarker
2024-07-16 23:57:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8b177a6da5
1 changed files with 8 additions and 1 deletions
|
@ -117,8 +117,15 @@ bool Node::establishes_stacking_context() const
|
|||
|
||||
if (!has_style())
|
||||
return false;
|
||||
if (is_root_element() || dom_node() == &document().root())
|
||||
|
||||
// We make a stacking context for the viewport. Painting and hit testing starts from here.
|
||||
if (is_viewport())
|
||||
return true;
|
||||
|
||||
// Root element of the document (<html>).
|
||||
if (is_root_element())
|
||||
return true;
|
||||
|
||||
auto position = computed_values().position();
|
||||
|
||||
// Element with a position value absolute or relative and z-index value other than auto.
|
||||
|
|
Loading…
Add table
Reference in a new issue