Data for a <style> element.
More...
#include "donner/svg/components/StylesheetComponent.h"
|
|
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).
|
| std::vector< RcString > | attributeSelectorNames |
| | Local names of the attributes referenced by attribute selectors in stylesheet, cached when the stylesheet is parsed.
|
| bool | attributeSelectorMatchesAnyName = false |
| | True when an attribute selector in stylesheet uses a wildcard local name, so any attribute write can change selector matching.
|
|
bool | selectorsDependOnTextContent = false |
| | True when a selector in stylesheet can change matching after a text edit, cached when the stylesheet is parsed.
|
◆ parseStylesheet() [1/3]
| void donner::svg::components::StylesheetComponent::parseStylesheet |
( |
const RcStringOrRef & | str | ) |
|
Parse the contents of the <style> element.
- Parameters
-
| str | The contents of the <style> element. |
◆ parseStylesheet() [2/3]
Parse the contents of the <style> element with source provenance.
- Parameters
-
| str | The contents of the <style> element. |
| sourceMap | Source map for local CSS offsets in str. |
◆ parseStylesheet() [3/3]
Parse stylesheet contents while collecting CSS-local diagnostics.
- Parameters
-
| str | Stylesheet contents. |
| sourceMap | Source provenance for the retained stylesheet. |
| warnings | Bounded sink receiving recoverable CSS diagnostics. |
◆ usesAttributeInSelector()
| bool donner::svg::components::StylesheetComponent::usesAttributeInSelector |
( |
std::string_view | localName | ) |
const |
|
inline |
Returns true if this stylesheet contains an attribute selector that could match an attribute with the given local name, meaning writing that attribute can change which elements the stylesheet matches.
Deliberately per-name rather than a single "uses any attribute selector" flag: the user agent stylesheet always contains one (*[xml|space=preserve]), so a single flag would be set for every document.
- Parameters
-
| localName | Attribute local name, compared case-insensitively to over-approximate. |
◆ attributeSelectorMatchesAnyName
| bool donner::svg::components::StylesheetComponent::attributeSelectorMatchesAnyName = false |
True when an attribute selector in stylesheet uses a wildcard local name, so any attribute write can change selector matching.
No CSS syntax produces this today.
◆ attributeSelectorNames
| std::vector<RcString> donner::svg::components::StylesheetComponent::attributeSelectorNames |
The documentation for this struct was generated from the following file: