summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/Node.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-10-06 15:33:09 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-06 16:25:26 +0200
commit49eb32453552db668b2fe008ceea0b87ea7c4948 (patch)
tree578d721da962ee365b5bb71d1c90e5c35ef3d0fb /Userland/Libraries/LibWeb/Layout/Node.cpp
parent277465e69974cb8d73030fd155463d1cc5ef00bc (diff)
downloadserenity-49eb32453552db668b2fe008ceea0b87ea7c4948.zip
LibWeb: Add Layout::Node::display()
This will return something sensible for style-less nodes as well.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/Node.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.cpp10
1 files changed, 10 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()) {