diff options
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/Node.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/Node.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 7d89ca0feb..1d9da526d7 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -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()) { diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h index da476acf81..3a7b9db406 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.h +++ b/Userland/Libraries/LibWeb/Layout/Node.h @@ -68,6 +68,8 @@ public: virtual bool can_have_children() const { return true; } + CSS::Display display() const; + bool is_inline() const; bool is_inline_block() const; |