summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/Node.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-28 17:11:23 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-29 20:09:49 +0200
commit9e4226f3539ec63c4fdd509697bbf6fad1f4c098 (patch)
treeafb0521db16ee91cc6248dc65856065b1792a213 /Userland/Libraries/LibWeb/Layout/Node.h
parent7abb512a86e909df602e45e55f9395b758233bf3 (diff)
downloadserenity-9e4226f3539ec63c4fdd509697bbf6fad1f4c098.zip
LibWeb: Create flex items for empty generated boxes
I couldn't find anything in the specs about this, but GMail uses empty generated boxes (`::before` and `::after` with `content: ""`) inside a flexbox container in order to vertically center things. The flexbox spec tells us to not generate flex items for empty *anonymous* boxes, so we continue not doing that, but generated boxes (any pseudo-element box) now always produce a flex item. This probably isn't perfect either, and we'll have to revisit it for stuff like `::first-letter`.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/Node.h')
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h
index 7fcd9c7953..ae5bb7805f 100644
--- a/Userland/Libraries/LibWeb/Layout/Node.h
+++ b/Userland/Libraries/LibWeb/Layout/Node.h
@@ -41,6 +41,9 @@ public:
DOM::Node const* dom_node() const;
DOM::Node* dom_node();
+ bool is_generated() const { return m_generated; }
+ void set_generated(bool b) { m_generated = b; }
+
Painting::Paintable* paintable() { return m_paintable; }
Painting::Paintable const* paintable() const { return m_paintable; }
void set_paintable(RefPtr<Painting::Paintable>);
@@ -153,6 +156,7 @@ private:
SelectionState m_selection_state { SelectionState::None };
bool m_is_flex_item { false };
+ bool m_generated { false };
};
class NodeWithStyle : public Node {