Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
donner::svg::components::StylesheetComponent Struct Reference

Data for a <style> element. More...

#include "donner/svg/components/StylesheetComponent.h"

Public Member Functions

bool isCssType () const
 Returns true if the <style> element has either no type attribute, or if it has been manually set to "text/css".
void parseStylesheet (const RcStringOrRef &str)
 Parse the contents of the <style> element.
void parseStylesheet (const RcStringOrRef &str, StylesheetSourceMap sourceMap)
 Parse the contents of the <style> element with source provenance.

Public Attributes

css::Stylesheet stylesheet
 The parsed stylesheet from the <style> element.
RcString text
 The raw CSS text the stylesheet was parsed from.
RcString type
 The type attribute of the <style> element.
StylesheetSourceMap sourceMap
 Optional mapping from CSS offsets to SVG document source.
bool isUserAgentStylesheet = false
 True if this is a user agent stylesheet, which is defined by the SVG specification and applied by default by the document. If set, this component is attached to an <svg> element instead. The stylesheet within is applied at lower priority, and should be considered a constant for Donner (it can be overridden, but the base style cannot be changed by the user).

Detailed Description

Member Function Documentation

◆ parseStylesheet() [1/2]

void donner::svg::components::StylesheetComponent::parseStylesheet ( const RcStringOrRef & str)

Parse the contents of the <style> element.

Parameters
strThe contents of the <style> element.

◆ parseStylesheet() [2/2]

void donner::svg::components::StylesheetComponent::parseStylesheet ( const RcStringOrRef & str,
StylesheetSourceMap sourceMap )

Parse the contents of the <style> element with source provenance.

Parameters
strThe contents of the <style> element.
sourceMapSource map for local CSS offsets in str.

The documentation for this struct was generated from the following file: