|
|
Donner
C++20 SVG rendering library
|
Options to modify the parsing behavior. More...
#include "donner/svg/parser/SVGParser.h"
Public Member Functions | |
| constexpr | Options () |
| Default options. | |
Public Attributes | |
| bool | disableUserAttributes = true |
| By default, the parser will ignore user-defined attributes (only presentation attributes will be parsed), to optimize for performance. | |
| bool | enableExperimental = false |
| Enable experimental or incomplete features. | |
| bool | parseAsInlineSVG = false |
| Parse as inlined SVG content. | |
Options to modify the parsing behavior.
| bool donner::svg::parser::SVGParser::Options::disableUserAttributes = true |
By default, the parser will ignore user-defined attributes (only presentation attributes will be parsed), to optimize for performance.
This behavior breaks some CSS matchers, which may use user-defined attributes to control styling.
For example:
If user attributes are disabled (disableUserAttributes is true), the above example will only match the first rule, because my-custom-attribute will be ignored during parsing.
To support rendering documents that use user-defined attributes, set this to false.
| bool donner::svg::parser::SVGParser::Options::enableExperimental = false |
Enable experimental or incomplete features.
This gates features which are not yet fully implemented and do not meet the quality and stability bar of the rest of the project.
This currently gates "<filter>", which has very limited support.
| bool donner::svg::parser::SVGParser::Options::parseAsInlineSVG = false |
Parse as inlined SVG content.
This will treat the input as a fragment of SVG content, rather than a full SVG document. This is useful for parsing SVG content embedded in HTML or other XML documents.
This enables the following shorthand without the xmlns attribute:
Instead of the full document: