Files
serenity/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
Andreas Kling dff48c9cd2 LibWeb: Make CSS::StyleProperties copy-on-write internally
This makes the way we've implemented the CSS `revert` keyword a lot less
expensive.

Until now, we were making a deep copy of all property values at the
start of each cascade origin. (Those are the values that `revert` would
bring us back to if encountered.)

With this patch, the revert property set becomes a shallow copy, and we
only clone the property set if the cascade ends up writing something.

This knocks a 5% profile item down to 1.3% on https://tailwindcss.com

(cherry picked from commit e399b472e9254294f48a057d8848814bdf25b2af)
2024-10-20 16:38:41 -04:00

133 KiB