mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
LibWeb: Make CSS selector parsing use StyleComponentValueRules
Also added some pseudo-classes that were handled in the deprecated parser: - :disabled - :enabled - :checked - :nth-child - :nth-last-child - :not
This commit is contained in:
parent
f7c79de0c5
commit
a558916e1f
5 changed files with 167 additions and 108 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2021, Sam Atkins <atkinssj@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -20,6 +21,17 @@ public:
|
|||
StyleFunctionRule();
|
||||
~StyleFunctionRule();
|
||||
|
||||
String const& name() const { return m_name; }
|
||||
Vector<String> const& values() const { return m_values; }
|
||||
// FIXME: This method is a temporary hack while much of the parser still expects a string, rather than tokens.
|
||||
String values_as_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
for (auto& value : m_values)
|
||||
builder.append(value);
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue