1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:45:10 +00:00

LibWeb: Use Layout::Node::display() everywhere

This commit is contained in:
Andreas Kling 2022-10-06 16:02:53 +02:00
parent 49eb324535
commit 13834cfdff
6 changed files with 24 additions and 33 deletions

View file

@ -91,11 +91,11 @@ bool Node::establishes_stacking_context() const
return true;
// Element that is a child of a flex container, with z-index value other than auto.
if (parent() && parent()->computed_values().display().is_flex_inside() && computed_values().z_index().has_value())
if (parent() && parent()->display().is_flex_inside() && computed_values().z_index().has_value())
return true;
// Element that is a child of a grid container, with z-index value other than auto.
if (parent() && parent()->computed_values().display().is_grid_inside() && computed_values().z_index().has_value())
if (parent() && parent()->display().is_grid_inside() && computed_values().z_index().has_value())
return true;
return computed_values().opacity() < 1.0f;
@ -591,22 +591,13 @@ CSS::Display Node::display() const
bool Node::is_inline() const
{
if (!has_style()) {
// NOTE: If this node doesn't have its own style, computed_values() will get style from the parent.
// This could give unwanted results. Besides, if we don't have style, we're some kind of inline text node.
return true;
}
return computed_values().display().is_inline_outside();
return display().is_inline_outside();
}
bool Node::is_inline_block() const
{
if (!has_style()) {
// NOTE: If this node doesn't have its own style, computed_values() will get style from the parent.
// This could give unwanted results. Besides, if we don't have style, we're some kind of inline text node.
return false;
}
return computed_values().display().is_inline_outside() && computed_values().display().is_flow_root_inside();
auto display = this->display();
return display.is_inline_outside() && display.is_flow_root_inside();
}
NonnullRefPtr<NodeWithStyle> NodeWithStyle::create_anonymous_wrapper() const