diff options
author | Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com> | 2023-02-24 02:51:08 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-24 20:55:40 +0100 |
commit | 8eeedce8053893f72ad72678a1f5e955f612a03b (patch) | |
tree | 368949127fab4fef4f53005ed7c2149a134a6ee6 /Userland/Libraries/LibWeb/Layout/Node.cpp | |
parent | 6092d81e4d2a5216875008ad83023d8c41eb6636 (diff) | |
download | serenity-8eeedce8053893f72ad72678a1f5e955f612a03b.zip |
LibWeb: Consider transform property while finding containing block
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/Node.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/Node.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 4581534ae6..60f8df41cc 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -59,7 +59,18 @@ bool Node::is_out_of_flow(FormattingContext const& formatting_context) const bool Node::can_contain_boxes_with_position_absolute() const { - return computed_values().position() != CSS::Position::Static || is<InitialContainingBlock>(*this); + if (computed_values().position() != CSS::Position::Static) + return true; + + if (is<InitialContainingBlock>(*this)) + return true; + + // https://w3c.github.io/csswg-drafts/css-transforms-1/#propdef-transform + // Any computed value other than none for the transform affects containing block and stacking context + if (!computed_values().transformations().is_empty()) + return true; + + return false; } static Box const* nearest_ancestor_capable_of_forming_a_containing_block(Node const& node) |