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

LibWeb: Stop putting the FormattingState nodes in a slow hash map

Instead, put them in a Vector<OwnPtr<NodeState>>. Each layout node
has a unique index into the vector. It's a simple serial ID assigned
during layout tree construction. Every new layout restarts the sequence
at 0 for the next ICB.

This is a huge layout speed improvement on all content.
This commit is contained in:
Andreas Kling 2022-07-11 17:12:58 +02:00
parent f6a97ff7d5
commit 0cacaf025d
6 changed files with 45 additions and 45 deletions

View file

@ -34,6 +34,8 @@ class Node : public TreeNode<Node> {
public:
virtual ~Node();
size_t serial_id() const { return m_serial_id; }
bool is_anonymous() const { return !m_dom_node; }
const DOM::Node* dom_node() const { return m_dom_node; }
DOM::Node* dom_node() { return m_dom_node; }
@ -141,6 +143,8 @@ private:
RefPtr<DOM::Node> m_dom_node;
RefPtr<Painting::Paintable> m_paintable;
size_t m_serial_id { 0 };
bool m_inline { false };
bool m_has_style { false };
bool m_visible { true };