1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27: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

@ -23,6 +23,8 @@ Node::Node(DOM::Document& document, DOM::Node* node)
: m_document(document)
, m_dom_node(node)
{
m_serial_id = m_document->next_layout_node_serial_id({});
if (m_dom_node)
m_dom_node->set_layout_node({}, this);
}