1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

LibWeb: Move Layout::Box::is_out_of_flow() to Layout::Node

I want to use this function in inline layout, where we're not just
dealing with boxes.
This commit is contained in:
Andreas Kling 2022-03-22 18:34:02 +01:00
parent 150e6a59c0
commit 74927fd218
4 changed files with 18 additions and 25 deletions

View file

@ -29,29 +29,6 @@ Box::~Box()
{
}
// https://www.w3.org/TR/css-display-3/#out-of-flow
bool Box::is_out_of_flow(FormattingContext const& formatting_context) const
{
// A box is out of flow if either:
// 1. It is floated (which requires that floating is not inhibited).
if (!formatting_context.inhibits_floating() && computed_values().float_() != CSS::Float::None)
return true;
// 2. It is "absolutely positioned".
switch (computed_values().position()) {
case CSS::Position::Absolute:
case CSS::Position::Fixed:
return true;
case CSS::Position::Static:
case CSS::Position::Relative:
case CSS::Position::Sticky:
break;
}
return false;
}
void Box::set_needs_display()
{
if (!is_inline()) {