1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

LibWeb: Implement calc() value equality check in a more efficient way

Instead of serializing two calc() values to String and then comparing
those strings, we can now compare calc() values by actually traversing
their internal CalculationNode tree.

This makes style recomputation faster on pages with lots of calc()
values since it's now much cheaper to check whether a property with
some calc() value actually changed.
This commit is contained in:
Andreas Kling 2024-01-09 12:41:43 +01:00
parent c994326d5a
commit 5b7a8891a6
3 changed files with 295 additions and 2 deletions

View file

@ -6552,6 +6552,7 @@ public:
{
builder.appendff("{: >{}}UNPARSED({})\n", "", indent, m_component_value.to_debug_string());
}
virtual bool equals(CalculationNode const&) const override { return false; }
private:
UnparsedCalculationNode(ComponentValue component_value)