mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user