Parse a CSS stylesheet into a list of selectors and their associated declarations.
More...
#include "donner/css/parser/StylesheetParser.h"
|
| struct | TextEdit |
| | A single replacement in the original stylesheet text. More...
|
Parse a CSS stylesheet into a list of selectors and their associated declarations.
◆ donner::css::parser::StylesheetParser::TextEdit
| struct donner::css::parser::StylesheetParser::TextEdit |
A single replacement in the original stylesheet text.
| Class Members |
|
size_t |
insertedLength |
|
|
size_t |
offset |
|
|
size_t |
removedLength |
|
◆ Parse()
Parse a CSS stylesheet into a list of selectors and their associated declarations, as well as @font-face rules.
Unconditional @import rules are retained in Stylesheet::imports, in source order, with their URLs exactly as authored; the parser never resolves or fetches them. Following the CSS Cascade 5 grammar, an import is valid only before every other retained rule except @layer statements that precede the first import (@charset is consumed first). A bare layer modifier creates a distinct anonymous layer and layer(name) references the named layer. Imports that appear later, have a malformed or empty target, or carry unsupported conditions receive a bounded warning at the @ token that never includes the target URL.
CSS @media and @supports blocks are unsupported. Their complete blocks, including nested styles and font faces, are ignored with a bounded warning at the outer @ token.
- Parameters
-
| str | Input stylesheet string. |
| warningSink | Sink to collect warnings (e.g. invalid selectors). |
- Returns
- Parsed stylesheet.
◆ TryReparseTextEdit()
Reparse a bounded qualified-rule window, or return nullopt for a full parse.
- Parameters
-
| old | Fully parsed stylesheet before the edit. |
| before | Original stylesheet text. |
| after | Updated stylesheet text. |
| edit | Byte replacement in the original stylesheet. |
| changed | Optional rule-window output, set only on success. |
The documentation for this class was generated from the following file: