Parse a CSS declaration list, which can be either from an HTML/SVG style attribute, or from the list of component values from within a rule.
More...
#include "donner/css/parser/DeclarationListParser.h"
|
| struct | SecurityStats |
| | Parsing work observed before a declaration list finishes or reaches a limit. More...
|
|
|
static constexpr std::size_t | kMaximumDeclarations = 4096 |
| | Maximum declarations or at-rules retained from one declaration list.
|
|
static constexpr std::size_t | kMaximumComponentValues = 64 * 1024 |
| | Maximum component values parsed across one declaration list.
|
Parse a CSS declaration list, which can be either from an HTML/SVG style attribute, or from the list of component values from within a rule.
For example, the following is a valid declaration list:
color: red; background-color: blue; font-size: 12px;
◆ donner::css::parser::DeclarationListParser::SecurityStats
| struct donner::css::parser::DeclarationListParser::SecurityStats |
Parsing work observed before a declaration list finishes or reaches a limit.
| Class Members |
|
size_t |
componentValues = 0 |
Component-value budget/accounting count. |
|
size_t |
declarations = 0 |
Result entries emitted, including invalid placeholders. |
|
bool |
rejected = false |
Whether a parsing limit rejected input. |
◆ Parse()
Parse a HTML/SVG style attribute, corresponding to a CSS <declaration-list>.
- Parameters
-
| str | Input string. |
| securityStats | Optional destination for bounded parsing counters. |
- Returns
- Parsed declaration list.
◆ ParseOnlyDeclarations()
| std::vector< Declaration > donner::css::parser::DeclarationListParser::ParseOnlyDeclarations |
( |
std::string_view | str, |
|
|
SecurityStats * | securityStats = nullptr ) |
|
static |
Parse a HTML/SVG style attribute, corresponding to a CSS <declaration-list>, but only returns the list of declarations, skipping any at-rules when parsing.
- Parameters
-
| str | Input string. |
| securityStats | Optional destination for bounded parsing counters. |
- Returns
- Parsed declaration list.
◆ ParseRuleDeclarations()
Parse a list of component values, from a Rule definition, corresponding to a CSS <declaration-list>.
- Parameters
-
| components | List of component values. |
| securityStats | Optional destination for bounded parsing counters. |
- Returns
- Parsed declaration list.
The documentation for this class was generated from the following file: