1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibWeb: Add basic support for the attr() CSS function

CSS Values and Units Module Level 5 defines attr as:
  `attr(<q-name> <attr-type>?, <declaration-value>?)`

This implementation does not contain support for the type argument,
effectively supporting `attr(<q-name>, <declaration-value>?)`
This commit is contained in:
Simon Wanner 2022-03-29 23:33:50 +02:00 committed by Andreas Kling
parent ba6ba67fa0
commit 6437f5da36
4 changed files with 56 additions and 19 deletions

View file

@ -151,6 +151,14 @@ public:
Position const& start_position() const { return m_start_position; }
Position const& end_position() const { return m_end_position; }
static Token of_string(FlyString str)
{
Token token;
token.m_type = Type::String;
token.m_value = move(str);
return token;
}
private:
Type m_type { Type::Invalid };