mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:17:45 +00:00
LibWeb: Add Layout::Node::display()
This will return something sensible for style-less nodes as well.
This commit is contained in:
parent
277465e699
commit
49eb324535
2 changed files with 12 additions and 0 deletions
|
@ -579,6 +579,16 @@ String Node::debug_description() const
|
||||||
return builder.to_string();
|
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
|
bool Node::is_inline() const
|
||||||
{
|
{
|
||||||
if (!has_style()) {
|
if (!has_style()) {
|
||||||
|
|
|
@ -68,6 +68,8 @@ public:
|
||||||
|
|
||||||
virtual bool can_have_children() const { return true; }
|
virtual bool can_have_children() const { return true; }
|
||||||
|
|
||||||
|
CSS::Display display() const;
|
||||||
|
|
||||||
bool is_inline() const;
|
bool is_inline() const;
|
||||||
bool is_inline_block() const;
|
bool is_inline_block() const;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue