Rule-related parsing routines, including parsing individual rules, lists of rules, and stylesheets.
More...
#include "donner/css/parser/RuleParser.h"
|
|
static constexpr std::size_t | kMaximumRules = 4096 |
| | Maximum rule-list entries emitted from one stylesheet or rule list.
|
|
static constexpr std::size_t | kMaximumComponentValues = 64 * 1024 |
| | Maximum component values accepted while parsing one rule list.
|
Rule-related parsing routines, including parsing individual rules, lists of rules, and stylesheets.
◆ donner::css::parser::RuleParser::SecurityStats
| struct donner::css::parser::RuleParser::SecurityStats |
Parsing work observed before a rule list finishes or reaches a limit.
| Class Members |
|
size_t |
componentValues = 0 |
Component values consumed so far. |
|
bool |
rejected = false |
Whether a parsing limit rejected input. |
|
size_t |
rules = 0 |
Rule-list entries emitted, including invalid placeholders. |
◆ ParseListOfRules()
| std::vector< Rule > donner::css::parser::RuleParser::ParseListOfRules |
( |
std::string_view | str, |
|
|
SecurityStats * | securityStats = nullptr ) |
|
static |
◆ ParseRule()
| std::optional< Rule > donner::css::parser::RuleParser::ParseRule |
( |
std::string_view | str | ) |
|
|
static |
◆ ParseStylesheet()
| std::vector< Rule > donner::css::parser::RuleParser::ParseStylesheet |
( |
std::string_view | str, |
|
|
SecurityStats * | securityStats = nullptr ) |
|
static |
Parse a CSS stylesheet into a list of rules, per https://www.w3.org/TR/css-syntax-3/#parse-stylesheet.
NOTE: This does not parse selectors, in most cases you should use StylesheetParser instead which handles selectors and returns a Stylesheet object to match against.
- Parameters
-
| str | Input stylesheet string. |
| securityStats | Optional destination for bounded parsing counters. |
- Returns
- Parsed stylesheet as a list of rules.
The documentation for this class was generated from the following file: