A CSS stylesheet, which is a list of rules.
More...
#include "donner/css/Stylesheet.h"
|
| struct | SecurityStats |
| | Resource-limit accounting produced while parsing an untrusted stylesheet. More...
|
|
|
| Stylesheet ()=default |
| | Default constructor.
|
| | Stylesheet (std::vector< SelectorRule > &&rules, std::vector< FontFace > &&fontFaces={}) |
| | Construct a stylesheet from a list of rules.
|
|
| Stylesheet (std::vector< SelectorRule > &&rules, std::vector< FontFace > &&fontFaces, SecurityStats securityStats) |
| | Construct a stylesheet with parser resource-limit accounting.
|
|
| Stylesheet (const Stylesheet &)=default |
| | Copy constructor.
|
|
Stylesheet & | operator= (const Stylesheet &)=default |
| | Copy assignment operator.
|
|
| Stylesheet (Stylesheet &&) noexcept=default |
| | Move constructor.
|
|
Stylesheet & | operator= (Stylesheet &&) noexcept=default |
| | Move assignment operator.
|
|
| ~Stylesheet ()=default |
| | Destructor.
|
|
std::span< const SelectorRule > | rules () const |
| | Get the list of rules in this stylesheet.
|
|
std::span< const FontFace > | fontFaces () const |
| | Get the list of @font-face rules in this stylesheet.
|
|
const SecurityStats & | securityStats () const |
| | Return resource-limit accounting from parsing this stylesheet.
|
|
|
static constexpr std::size_t | kMaximumDeclarations = 16 * 1024 |
| | Maximum declarations retained across one stylesheet.
|
|
| std::ostream & | operator<< (std::ostream &os, const Stylesheet &stylesheet) |
| | Output a human-readable representation of the stylesheet to a stream.
|
A CSS stylesheet, which is a list of rules.
This is created by the parser, from the CSS::ParseStylesheet() API.
- Examples
- custom_css_parser.cc.
◆ donner::css::Stylesheet::SecurityStats
| struct donner::css::Stylesheet::SecurityStats |
Resource-limit accounting produced while parsing an untrusted stylesheet.
| Class Members |
|
size_t |
componentValues = 0 |
|
|
size_t |
declarations = 0 |
|
|
bool |
rejected = false |
|
|
size_t |
rules = 0 |
|
◆ Stylesheet()
| donner::css::Stylesheet::Stylesheet |
( |
std::vector< SelectorRule > && | rules, |
|
|
std::vector< FontFace > && | fontFaces = {} ) |
|
inlineexplicit |
Construct a stylesheet from a list of rules.
- Parameters
-
| rules | List of rules, ownership is taken. |
| fontFaces | Optional list of @font-face declarations, ownership is taken. |
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
const Stylesheet & | stylesheet ) |
|
friend |
Output a human-readable representation of the stylesheet to a stream.
- Parameters
-
The documentation for this class was generated from the following file: