1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:57:35 +00:00

LibWeb: Add Layout::Node::display()

This will return something sensible for style-less nodes as well.
This commit is contained in:
Andreas Kling 2022-10-06 15:33:09 +02:00
parent 277465e699
commit 49eb324535
2 changed files with 12 additions and 0 deletions

View file

@ -579,6 +579,16 @@ String Node::debug_description() const
return builder.to_string();
}
CSS::Display Node::display() const
{
if (!has_style()) {
// NOTE: No style means this is dumb text content.
return CSS::Display(CSS::Display::Outside::Inline, CSS::Display::Inside::Flow);
}
return computed_values().display();
}
bool Node::is_inline() const
{
if (!has_style()) {