mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +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:
parent
ba6ba67fa0
commit
6437f5da36
4 changed files with 56 additions and 19 deletions
|
@ -1625,27 +1625,27 @@ private:
|
|||
|
||||
class UnresolvedStyleValue final : public StyleValue {
|
||||
public:
|
||||
static NonnullRefPtr<UnresolvedStyleValue> create(Vector<StyleComponentValueRule>&& values, bool contains_var)
|
||||
static NonnullRefPtr<UnresolvedStyleValue> create(Vector<StyleComponentValueRule>&& values, bool contains_var_or_attr)
|
||||
{
|
||||
return adopt_ref(*new UnresolvedStyleValue(move(values), contains_var));
|
||||
return adopt_ref(*new UnresolvedStyleValue(move(values), contains_var_or_attr));
|
||||
}
|
||||
virtual ~UnresolvedStyleValue() override = default;
|
||||
|
||||
virtual String to_string() const override;
|
||||
|
||||
Vector<StyleComponentValueRule> const& values() const { return m_values; }
|
||||
bool contains_var() const { return m_contains_var; }
|
||||
bool contains_var_or_attr() const { return m_contains_var_or_attr; }
|
||||
|
||||
private:
|
||||
UnresolvedStyleValue(Vector<StyleComponentValueRule>&& values, bool contains_var)
|
||||
UnresolvedStyleValue(Vector<StyleComponentValueRule>&& values, bool contains_var_or_attr)
|
||||
: StyleValue(Type::Unresolved)
|
||||
, m_values(move(values))
|
||||
, m_contains_var(contains_var)
|
||||
, m_contains_var_or_attr(contains_var_or_attr)
|
||||
{
|
||||
}
|
||||
|
||||
Vector<StyleComponentValueRule> m_values;
|
||||
bool m_contains_var { false };
|
||||
bool m_contains_var_or_attr { false };
|
||||
};
|
||||
|
||||
class UnsetStyleValue final : public StyleValue {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue