mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibWeb: Layout nodes without own style can't be absolutely positioned
The only layout nodes that don't have their own style are LayoutText (they inherit the style from their parent element since text cannot be styled by CSS.) However, it never makes sense for text nodes to have absolute position so don't claim it.
This commit is contained in:
parent
9825f7792b
commit
ce3260c6bf
Notes:
sideshowbarker
2024-07-19 05:38:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ce3260c6bf9
1 changed files with 4 additions and 0 deletions
|
@ -200,12 +200,16 @@ Gfx::FloatPoint LayoutNode::box_type_agnostic_position() const
|
|||
|
||||
bool LayoutNode::is_absolutely_positioned() const
|
||||
{
|
||||
if (!has_style())
|
||||
return false;
|
||||
auto position = style().position();
|
||||
return position == CSS::Position::Absolute || position == CSS::Position::Fixed;
|
||||
}
|
||||
|
||||
bool LayoutNode::is_fixed_position() const
|
||||
{
|
||||
if (!has_style())
|
||||
return false;
|
||||
return style().position() == CSS::Position::Fixed;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue