LibWeb: Make CSS::Parser::ComponentValue immutable

`ComponentValue` instances are never mutated, so let's make them
immutable to indicate that they could potentially be cached in the
future.
This commit is contained in:
Jonne Ransijn 2024-10-31 18:24:12 +01:00 committed by Sam Atkins
parent 138135e0e6
commit 90b2142658
Notes: github-actions[bot] 2024-11-06 09:44:33 +00:00

View file

@ -24,12 +24,10 @@ public:
~ComponentValue(); ~ComponentValue();
bool is_block() const { return m_value.has<SimpleBlock>(); } bool is_block() const { return m_value.has<SimpleBlock>(); }
SimpleBlock& block() { return m_value.get<SimpleBlock>(); }
SimpleBlock const& block() const { return m_value.get<SimpleBlock>(); } SimpleBlock const& block() const { return m_value.get<SimpleBlock>(); }
bool is_function() const { return m_value.has<Function>(); } bool is_function() const { return m_value.has<Function>(); }
bool is_function(StringView name) const; bool is_function(StringView name) const;
Function& function() { return m_value.get<Function>(); }
Function const& function() const { return m_value.get<Function>(); } Function const& function() const { return m_value.get<Function>(); }
bool is_token() const { return m_value.has<Token>(); } bool is_token() const { return m_value.has<Token>(); }