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

LibWeb: Add mutable_computed_values() for NodeWithStyle

This fixes the issue that we previously had to use a gross static_cast
whenever we wanted to mutate computed values outside of the Node
methods.
This commit is contained in:
Aliaksandr Kalenik 2023-09-12 12:02:16 +02:00 committed by Andreas Kling
parent 44b2735b9e
commit 7eee3f6952
2 changed files with 4 additions and 3 deletions

View file

@ -209,6 +209,7 @@ public:
virtual ~NodeWithStyle() override = default;
const CSS::ImmutableComputedValues& computed_values() const { return static_cast<const CSS::ImmutableComputedValues&>(m_computed_values); }
CSS::MutableComputedValues& mutable_computed_values() { return static_cast<CSS::MutableComputedValues&>(m_computed_values); }
void apply_style(const CSS::StyleProperties&);