Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
CssParserBenchInputs.h File Reference

Shared representative inputs for CSS parser benchmarks. More...

#include <cstddef>
#include <string_view>
#include "donner/css/parser/details/Tokenizer.h"
Include dependency graph for CssParserBenchInputs.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

constexpr std::string_view donner::benchmarks::kNulLongName (kNulLongNameData, sizeof(kNulLongNameData) - 1)
std::size_t donner::benchmarks::ConsumeCssTokens (std::string_view input)
 Consume every token in input and return the number consumed.

Variables

constexpr std::string_view donner::benchmarks::kInlineStyleShort = "fill:red"
 Tiny inline style with one declaration.
constexpr std::string_view donner::benchmarks::kInlineStyleMedium
 Moderate inline style with several declarations.
constexpr std::string_view donner::benchmarks::kStylesheetSmall
 Short stylesheet with a handful of simple selectors and declarations.
constexpr std::string_view donner::benchmarks::kStylesheetMedium
 Medium stylesheet with selectors and nested function values typical of an SVG style block.
constexpr std::string_view donner::benchmarks::kSelectorComplex
 Selector with a class, attribute, pseudo-class, and combinator.
constexpr std::string_view donner::benchmarks::kEscapedLongName
 Long identifier which requires escape decoding after an ordinary prefix.
constexpr char donner::benchmarks::kNulLongNameData [] = "abcdefghijklmnopqrstuvwxyz-long-prefix\0suffix"
 Long identifier which requires NUL replacement after an ordinary prefix.

Detailed Description

Shared representative inputs for CSS parser benchmarks.

Variable Documentation

◆ kEscapedLongName

std::string_view donner::benchmarks::kEscapedLongName
inlineconstexpr
Initial value:
=
"abcdefghijklmnopqrstuvwxyz-long-prefix\\20suffix"

Long identifier which requires escape decoding after an ordinary prefix.

◆ kInlineStyleMedium

std::string_view donner::benchmarks::kInlineStyleMedium
inlineconstexpr
Initial value:
=
"fill:#ff8040;stroke:rgb(0,128,255);stroke-width:2;stroke-linecap:round;"
"stroke-linejoin:bevel;opacity:0.8;stroke-dasharray:4 2 1"

Moderate inline style with several declarations.

◆ kSelectorComplex

std::string_view donner::benchmarks::kSelectorComplex
inlineconstexpr
Initial value:
=
"div.container > .row[data-role=\"primary\"]:nth-child(2n+1):hover"

Selector with a class, attribute, pseudo-class, and combinator.

◆ kStylesheetMedium

std::string_view donner::benchmarks::kStylesheetMedium
inlineconstexpr
Initial value:
= R"CSS(
svg { font-family: sans-serif; font-size: 14px; }
g.layer { opacity: 0.9; }
g.layer > rect { fill: #eeeeee; stroke: #333; }
rect.highlight { fill: url(#grad1); stroke-width: 2; }
rect.highlight:hover { fill: url(#grad2); }
circle[data-kind="pin"] { fill: hsl(200, 80%, 50%); }
circle[data-kind="pin"]:nth-child(2n+1) { fill: hsl(20, 80%, 50%); }
path.outline { fill: none; stroke: currentColor; stroke-width: 1.5; }
text { font-weight: 600; fill: #111; }
text.muted { fill: #888; font-style: italic; }
.marker { stroke-linecap: round; stroke-linejoin: round; }
g#legend > rect { fill: white; stroke: #ccc; }
g#legend > text { font-size: 12px; }
use[href="#icon-warn"] { fill: orange; }
.hidden { display: none !important; }
)CSS"

Medium stylesheet with selectors and nested function values typical of an SVG style block.

◆ kStylesheetSmall

std::string_view donner::benchmarks::kStylesheetSmall
inlineconstexpr
Initial value:
=
"svg { fill: red; stroke: black; }\n"
"rect { fill: blue; }\n"
".outline { stroke-width: 2; stroke: currentColor; }\n"

Short stylesheet with a handful of simple selectors and declarations.