diff options
author | Sam Atkins <atkinssj@gmail.com> | 2021-06-30 16:27:37 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-11 23:19:56 +0200 |
commit | a558916e1f77ed21c49e2e59cd83f09ce2dfa5ac (patch) | |
tree | d5a769ec7e76312d53d7f429acf2443a5de53751 /Userland/Libraries/LibWeb/CSS/Parser/StyleFunctionRule.h | |
parent | f7c79de0c504c54ae482e4b57921b5c69172e905 (diff) | |
download | serenity-a558916e1f77ed21c49e2e59cd83f09ce2dfa5ac.zip |
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
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Parser/StyleFunctionRule.h')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/StyleFunctionRule.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/StyleFunctionRule.h b/Userland/Libraries/LibWeb/CSS/Parser/StyleFunctionRule.h index 8d0fd15de3..82de57c3e8 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/StyleFunctionRule.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/StyleFunctionRule.h @@ -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: |