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

LibWeb: Allocate storage for pseudo element layout nodes on demand

This saves us 64 bytes for every element that doesn't have pseudo
elements associated with it. Which is most of them. :^)
This commit is contained in:
Andreas Kling 2023-11-19 20:30:13 +01:00
parent 37505d9746
commit 48dbec8a9e
2 changed files with 21 additions and 8 deletions

View file

@ -412,7 +412,8 @@ private:
Optional<FlyString> m_id;
Array<JS::GCPtr<Layout::Node>, to_underlying(CSS::Selector::PseudoElement::PseudoElementCount)> m_pseudo_element_nodes;
using PseudoElementLayoutNodes = Array<JS::GCPtr<Layout::Node>, to_underlying(CSS::Selector::PseudoElement::PseudoElementCount)>;
OwnPtr<PseudoElementLayoutNodes> m_pseudo_element_nodes;
// https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reaction-queue
// All elements have an associated custom element reaction queue, initially empty. Each item in the custom element reaction queue is of one of two types: