Holds CSS properties for a single element. More...
#include "donner/svg/properties/PropertyRegistry.h"
Public Member Functions | |
| PropertyRegistry () | |
| Constructor. | |
| ~PropertyRegistry () | |
| Destructor. | |
| PropertyRegistry (const PropertyRegistry &) | |
| Copy constructor. | |
| PropertyRegistry (PropertyRegistry &&) noexcept | |
| Move constructor. | |
| PropertyRegistry & | operator= (const PropertyRegistry &) |
| Copy assignment operator. | |
| PropertyRegistry & | operator= (PropertyRegistry &&) noexcept |
| Move assignment operator. | |
| auto | allProperties () const |
| Return a tuple of all properties within the PropertyRegistry. | |
| auto | allPropertiesMutable () |
| Return a mutable tuple of all properties within the PropertyRegistry. | |
| size_t | numPropertiesSet () const |
| Return the number of properties set within the PropertyRegistry. | |
| void | resolveElementColors (ParseWarningSink &warningSink) |
| Resolve resource-color overlays and deferred diagnostics before computing inheritance. | |
| PropertyRegistry | inheritFrom (const PropertyRegistry &parent, PropertyInheritOptions options=PropertyInheritOptions::All) const |
| Inherit the value of each element in the stylesheet. | |
| std::size_t | complexPropertyBytes () const |
| Dynamic bytes in inheritable complex property values that copying would retain. | |
| void | resolveFontSize (double parentFontSizePx) |
| Resolve font-size from relative units (em, %, ex) to absolute pixels. | |
| void | resolveTextDecorationThickness (double rootFontSizePx=16.0) |
| Compute font-relative decoration lengths before a descendant explicitly inherits them. | |
| void | resolveInsetClipLengths (double rootFontSizePx) |
| Resolve supported inset offsets to computed pixels while retaining percentages. Unrepresentable offsets keep an empty clipping region. Call after resolving this element's computed font size, before descendants inherit styles. | |
| void | resolveFontWeight (int parentFontWeight) |
| Resolve relative font-weight keywords (bolder/lighter) against the parent's computed font-weight. | |
| void | resolveFontStretch (int parentFontStretch) |
| Resolve relative font-stretch keywords (narrower/wider) against the parent's computed font-stretch value. | |
| std::optional< ParseDiagnostic > | parseProperty (const css::Declaration &declaration, css::Specificity specificity) |
| Parse a single declaration, adding it to the property registry. | |
| bool | parseStyle (std::string_view str) |
| Parse a SVG style attribute, and set the parsed values on this PropertyRegistry. | |
| void | clearStyleAttributeProperties () |
| Clear every property that was set from a style="" attribute, leaving presentation attributes (specificity 0,0,0) and stylesheet-origin declarations intact. | |
| ParseResult< bool > | parsePresentationAttribute (std::string_view name, std::string_view value, EntityHandle handle=EntityHandle(), css::Specificity specificity={}) |
| Parse a common presentation attribute (CSS properties like fill, stroke, etc.) or transform. | |
Static Public Member Functions | |
| static constexpr size_t | numProperties () |
| Return the size of the tuple returned by allProperties(). | |
| template<size_t Start, size_t End, class F> | |
| static constexpr void | forEachProperty (const F &f) |
| Calls a compile time functor for each property in the registry. | |
| static std::span< const std::string_view > | propertyNames () |
| Returns all CSS property names understood by this registry. | |
| static bool | isPresentationAttributeName (std::string_view name) |
| Returns true if a name is a valid SVG presentation attribute. | |
| static bool | isPresentationAttributeInherited (std::string_view name) |
| Returns true if a presentation attribute participates in inheritance. | |
Public Attributes | |
| Property< css::Color, PropertyCascade::Inherit > | color |
| color property, which stores the context color of the element. For painting shapes, use stroke or fill instead. | |
| Property< css::Color > | floodColor |
| flood-color property, used by filter floods and drop shadows. Only explicit inheritance propagates this color from an ancestor. | |
| Property< css::Color > | stopColor |
| stop-color property, used by gradient stops. Only explicit inheritance propagates this color from an ancestor. | |
| Property< css::Color > | lightingColor |
| Light-source color for diffuse and specular lighting. Only explicit inheritance propagates it. | |
| Property< Display > | display {"display", []() -> std::optional<Display> { return Display::Inline; }} |
| display property, which determines how the element is rendered. Set to Display::None to hide the element. | |
| Property< double > | opacity {"opacity", []() -> std::optional<double> { return 1.0; }} |
| opacity property, which determines the opacity of the element. A value of 0.0 will make the element invisible. | |
| Property< Visibility, PropertyCascade::Inherit > | visibility |
| visibility property, which determines whether the element is visible. Set to Visibility::Hidden to hide the element. Compared to display with Display::None, hiding the element will not remove it from the document, so it will still contribute to bounding boxes. | |
| Property< Overflow > | overflow |
| overflow property, which determines how content that overflows the element's box is handled. Defaults to visible. | |
| Property< TransformOrigin > | transformOrigin |
| transform-origin property, which sets the origin for transformations. | |
| Property< PaintServer, PropertyCascade::PaintInherit > | fill |
| fill property, which determines the color of the element's interior. Defaults to black. | |
| Property< FillRule, PropertyCascade::Inherit > | fillRule |
| fill-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to FillRule::NonZero. | |
| Property< double, PropertyCascade::Inherit > | fillOpacity |
| fill-opacity property, which determines the opacity of the element's interior. Defaults to 1.0. A value of 0.0 will make the interior invisible. | |
| Property< PaintServer, PropertyCascade::PaintInherit > | stroke |
| stroke property, which determines the color of the element's outline stroke. Defaults to none. | |
| Property< double, PropertyCascade::Inherit > | strokeOpacity |
| stroke-opacity property, which determines the opacity of the element's outline stroke. Defaults to 1.0. A value of 0.0 will make the outline invisible. | |
| Property< Lengthd, PropertyCascade::Inherit > | strokeWidth |
| stroke-width property, which determines the width of the element's outline stroke. Defaults to 1.0. | |
| Property< StrokeLinecap, PropertyCascade::Inherit > | strokeLinecap |
| stroke-linecap property, which determines the shape of the element's outline stroke at the ends of the path. Defaults to StrokeLinecap::Butt. | |
| Property< StrokeLinejoin, PropertyCascade::Inherit > | strokeLinejoin |
| stroke-linejoin property, which determines the shape of the element's outline stroke in between line segments. Defaults to StrokeLinejoin::Miter. | |
| Property< double, PropertyCascade::Inherit > | strokeMiterlimit |
| stroke-miterlimit property, which determines the limit of the ratio of the miter length to the stroke width. Defaults to 4.0. | |
| Property< StrokeDasharray, PropertyCascade::Inherit > | strokeDasharray |
| stroke-dasharray property, which determines the pattern of dashes and gaps used to stroke paths. | |
| Property< Lengthd, PropertyCascade::Inherit > | strokeDashoffset |
| stroke-dashoffset property, which determines the distance into the dash pattern to start the stroke. | |
| Property< VectorEffect > | vectorEffect |
| vector-effect property, which modifies how the element is affected by coordinate system transformations. Not inherited per spec. Defaults to VectorEffect::None. Only VectorEffect::NonScalingStroke is honored during rendering. | |
| Property< ClipPath, PropertyCascade::None > | clipPath |
| clip-path property, which determines the shape of the element's clipping region. Defaults to none. | |
| Property< ClipRule, PropertyCascade::Inherit > | clipRule |
| clip-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to ClipRule::NonZero. | |
| Property< Reference, PropertyCascade::None > | mask |
| mask property, which determines the shape of the element's clipping region. Defaults to none. | |
| Property< MaskType > | maskType |
| mask-type property, which selects how rendered <mask> content becomes coverage. Defaults to luminance and is not inherited. | |
| Property< ColorInterpolation, PropertyCascade::Inherit > | colorInterpolation |
| Inherited color-interpolation property. Defaults to sRGB; used by luminance masks. | |
| Property< std::vector< FilterEffect > > | filter |
| filter property, which determines the filter effect(s) to apply to the element. Defaults to an empty list (no filter). Supports CSS filter function lists like blur(5px) grayscale(). | |
| Property< ColorInterpolationFilters, PropertyCascade::Inherit > | colorInterpolationFilters |
| color-interpolation-filters property, which determines the color space for filter operations. Defaults to ColorInterpolationFilters::LinearRGB. Inherited. | |
| Property< PointerEvents, PropertyCascade::Inherit > | pointerEvents |
| pointer-events property, which determines how the element responds to pointer events (such as clicks or hover). Defaults to PointerEvents::Auto. | |
| Property< Cursor, PropertyCascade::Inherit > | cursor |
| cursor property, which defines the mouse cursor to display when hovering over the element. Defaults to an empty image list and CursorType::Auto fallback. Inherited. | |
| Property< Reference, PropertyCascade::Inherit > | markerStart |
| marker-start property, which determines the marker to be drawn at the start of the path. | |
| Property< Reference, PropertyCascade::Inherit > | markerMid |
| marker-mid property, which determines the marker to be drawn at the middle of the path. | |
| Property< Reference, PropertyCascade::Inherit > | markerEnd |
| marker-end property, which determines the marker to be drawn at the end of the path. | |
| Property< SmallVector< RcString, 1 >, PropertyCascade::Inherit > | fontFamily |
| font-family property, which determines the font family for text content. Inherited. | |
| Property< Lengthd, PropertyCascade::Inherit > | fontSize |
| font-size property, which determines the font size for text content. Inherited. Initial value is medium, which maps to the UA default font size (12px). | |
| Property< int, PropertyCascade::Inherit > | fontWeight |
| font-weight property, which determines the font weight (boldness) for text content. Inherited. Value is a numeric weight (100-900), where 400=normal and 700=bold. The relative keywords bolder/lighter are stored as sentinel values and resolved by resolveFontWeight() during style cascade. | |
| Property< FontStyle, PropertyCascade::Inherit > | fontStyle |
| font-style property, which determines the style (normal/italic/oblique) for text content. Inherited. Defaults to FontStyle::Normal. | |
| Property< int, PropertyCascade::Inherit > | fontStretch |
| font-stretch property, which determines the width (condensed/expanded) for text content. Inherited. Stored as the underlying integer of FontStretch for sentinel support. Defaults to FontStretch::Normal (5). | |
| Property< FontVariant, PropertyCascade::Inherit > | fontVariant |
| font-variant shorthand property (SVG 1.1 subset: normal | small-caps). Inherited. Defaults to FontVariant::Normal. | |
| Property< FontSynthesisSmallCaps, PropertyCascade::Inherit > | fontSynthesisSmallCaps |
| Inherited CSS small-caps synthesis policy; native features remain enabled. | |
| Property< FontSynthesisStyle, PropertyCascade::Inherit > | fontSynthesisStyle |
| Inherited CSS permission to synthesize an oblique face; native faces remain enabled. | |
| Property< FontKerning, PropertyCascade::Inherit > | fontKerning |
| font-kerning property. Inherited. auto and normal enable kerning; none disables it. | |
| Property< std::optional< double >, PropertyCascade::Inherit > | fontSizeAdjust |
| font-size-adjust property. Inherited. An empty value represents the initial none value. | |
| Property< OverflowWrap, PropertyCascade::Inherit > | overflowWrap |
| Inherited emergency line-breaking policy; word-wrap is an alias of this property. | |
| Property< TextTransform, PropertyCascade::Inherit > | textTransform |
| Supported inherited CSS text-transform operation; defaults to none. | |
| Property< WhiteSpace, PropertyCascade::Inherit > | whiteSpace |
| CSS white-space collapsing and wrapping policy, inherited by text descendants. | |
| Property< TextAnchor, PropertyCascade::Inherit > | textAnchor |
| text-anchor property, which determines the alignment of text relative to its anchor point. Inherited. Defaults to TextAnchor::Start. | |
| Property< TextDecoration > | textDecoration |
| text-decoration-line, which determines decoration lines drawn on text. The text-decoration shorthand also sets it, and the property keeps the shorthand's name. Not inherited. Defaults to TextDecoration::None. | |
| Property< TextDecorationStyle > | textDecorationStyle |
| text-decoration-style of decorations originating on this element; not inherited. | |
| Property< css::Color > | textDecorationColor |
| text-decoration-color of decorations originating on this element; not inherited. | |
| Property< TextDecorationThickness > | textDecorationThickness |
| CSS thickness of decorations originating on this element; not inherited. | |
| Property< DominantBaseline, PropertyCascade::Inherit > | dominantBaseline |
| dominant-baseline property, which determines the baseline alignment for text. Inherited (CSS Inline Layout 3). Defaults to DominantBaseline::Auto. | |
| Property< Lengthd, PropertyCascade::Inherit > | letterSpacing |
| letter-spacing property, extra spacing between characters. Inherited. "normal" maps to 0. Defaults to 0 (normal). | |
| Property< Lengthd, PropertyCascade::Inherit > | wordSpacing |
| word-spacing property, extra spacing between words (U+0020 space characters). Inherited. "normal" maps to 0. Defaults to 0 (normal). | |
| Property< Lengthd > | baselineShift |
| baseline-shift property. Shifts the dominant baseline of the element. Not inherited. "baseline" = 0, "sub"/"super" map to em-relative offsets. Positive = shift up (per CSS). Stored as Lengthd. | |
| Property< DominantBaseline > | alignmentBaseline |
| alignment-baseline property. Specifies how an inline element aligns with its parent's baseline. Uses the same enum as dominant-baseline (baseline parses to DominantBaseline::Auto - both defer to the dominant baseline). Not inherited. | |
| Property< WritingMode, PropertyCascade::Inherit > | writingMode |
| writing-mode property, controlling text flow direction. Inherited. | |
| Property< TextOrientation, PropertyCascade::Inherit > | textOrientation |
| text-orientation property, controlling glyph orientation in vertical text. Inherited. | |
| Property< Lengthd > | inlineSize |
| inline-size property (SVG2). When set to a positive length on a <text> element it establishes an automatic wrapping area whose measure (extent in the inline axis) is the given length; text greedily wraps to that measure. Not inherited. The initial value 0 means "no wrapping area" (the text behaves as ordinary single-line SVG text). | |
| Property< MixBlendMode > | mixBlendMode |
| mix-blend-mode property. Controls how an element composites with its backdrop. Not inherited. Defaults to Normal (SourceOver). | |
| Property< Isolation > | isolation |
| isolation property. Forces creation of a new stacking context. Not inherited. Defaults to Auto. | |
| Property< ImageRendering, PropertyCascade::Inherit > | imageRendering |
| image-rendering property. Selects smooth, crisp, or two-stage pixelated sampling. Inherited. | |
| Property< PaintOrder, PropertyCascade::Inherit > | paintOrder |
| paint-order property. Controls the order in which fill, stroke, and markers of a shape/text are painted. Inherited. Defaults to fill, stroke, markers. | |
| Property< Lengthd, PropertyCascade::Inherit > | textIndent |
| CSS text-indent: inherited first-line start margin in a fixed inline-size text area. Absolute lengths and em compute to pixels; percentages resolve against this text area's inline measure. hanging, each-line and other relative units are not supported. | |
| std::map< RcString, parser::UnparsedProperty > | unparsedProperties |
| Properties which don't have specific listings above, which are stored as raw css declarations. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const PropertyRegistry ®istry) |
| Ostream output operator, for debugging which outputs a human-readable representation of all of the properties. | |
Holds CSS properties for a single element.
This class stores common properties which may be applied to any element, plus unparsedProperties which contains element-specific properties which are applied if the element matches.
For unparsedProperties, presentation attributes specified in CSS such as transform will be stored here until they can be applied to the element.
| Property | Member | Default |
|---|---|---|
| color | color | black |
| flood-color | floodColor | black |
| stop-color | stopColor | black |
| lighting-color | lightingColor | white |
| display | display | inline |
| opacity | Opacity | 1.0 |
| visibility | visibility | visible |
| overflow | overflow | visible |
| fill | fill | black |
| fill-rule | fillRule | nonzero |
| fill-opacity | fillOpacity | 1.0 |
| stroke | stroke | none |
| stroke-opacity | strokeOpacity | 1.0 |
| stroke-width | strokeWidth | 1.0 |
| stroke-linecap | strokeLinecap | butt |
| stroke-linejoin | strokeLinejoin | miter |
| stroke-miterlimit | strokeMiterlimit | 4.0 |
| stroke-dasharray | strokeDasharray | none |
| stroke-dashoffset | strokeDashoffset | 0 |
| clip-path | clipPath | none |
| clip-rule | clipRule | nonzero |
| mask | Mask | none |
| mask-type | maskType | luminance |
| pointer-events | pointerEvents | auto |
| cursor | cursor | auto |
| marker-start | markerStart | none |
| marker-mid | markerMid | none |
| marker-end | markerEnd | none |
| font-family | fontFamily | serif |
| font-size | fontSize | 16px |
| text-transform | textTransform | none |
| overflow-wrap (word-wrap alias) | overflowWrap | normal |
| font-synthesis-small-caps | fontSynthesisSmallCaps | auto |
| font-synthesis-style | fontSynthesisStyle | auto |
| white-space | whiteSpace | normal |
| text-anchor | textAnchor | start |
| text-decoration | shorthand for the four longhands below | none |
| text-decoration-line | textDecoration | none |
| text-decoration-style | textDecorationStyle | solid |
| text-decoration-color | textDecorationColor | (declaring element's fill) |
| text-decoration-thickness | textDecorationThickness | auto |
| dominant-baseline | dominantBaseline | auto |
| inline-size | inlineSize | 0 |
| text-indent | textIndent | 0px |
|
inline |
Return a tuple of all properties within the PropertyRegistry.
To get the size of the tuple, use numProperties().
|
inline |
Return a mutable tuple of all properties within the PropertyRegistry.
| void donner::svg::PropertyRegistry::clearStyleAttributeProperties | ( | ) |
Clear every property that was set from a style="" attribute, leaving presentation attributes (specificity 0,0,0) and stylesheet-origin declarations intact.
Identifies style-origin properties by css::Specificity::isStyleAttribute(), including both normal and important inline declarations.
Use this before re-calling parseStyle on the same registry to get "replace the `style=""` contribution" semantics while preserving fill="red" and the like.
Also clears entries from unparsedProperties with either inline-origin priority.
|
inlinestaticconstexpr |
Calls a compile time functor for each property in the registry.
Example:
| Start | Index of the current property to call. |
| End | Total number of properties in the registry. |
| F | Type of the functor object, with signature void(std::integral_constant<size_t>). |
| f | Functor instance. |
|
nodiscard |
Inherit the value of each element in the stylesheet.
| parent | PropertyRegistry from this element's direct parent, where properties will be inherited from. |
| options | Options for how to inherit properties, which can be used to skip inheritance for a category of properties. |
|
static |
Returns true if a presentation attribute participates in inheritance.
This uses the underlying property cascade metadata instead of a hand-maintained list in DOM mutation code.
| name | Presentation attribute name. |
|
static |
Returns true if a name is a valid SVG presentation attribute.
| name | Attribute name. |
name can be parsed as a presentation attribute. | ParseResult< bool > donner::svg::PropertyRegistry::parsePresentationAttribute | ( | std::string_view | name, |
| std::string_view | value, | ||
| EntityHandle | handle = EntityHandle(), | ||
| css::Specificity | specificity = {} ) |
Parse a common presentation attribute (CSS properties like fill, stroke, etc.) or transform.
This handles properties stored in PropertyRegistry and the transform attribute. For element-specific presentation attributes (like cx on circles), use parser::ParsePresentationAttribute separately.
| name | Name of the attribute. |
| value | Value of the attribute, parsed as a CSS value. |
| handle | Entity handle, needed for transform attribute parsing. |
| specificity | Cascade level; defaults to a presentation attribute. |
| std::optional< ParseDiagnostic > donner::svg::PropertyRegistry::parseProperty | ( | const css::Declaration & | declaration, |
| css::Specificity | specificity ) |
Parse a single declaration, adding it to the property registry.
| declaration | Declaration to parse. |
| specificity | Specificity of the declaration. |
| bool donner::svg::PropertyRegistry::parseStyle | ( | std::string_view | str | ) |
Parse a SVG style attribute, and set the parsed values on this PropertyRegistry.
Does not clear existing properties, new ones are applied additively.
Parses the string as a CSS "<declaration-list>", ignoring any parse errors or unsupported properties
| str | Input string from a style attribute, e.g. "fill: red; stroke: blue". |
|
static |
Returns all CSS property names understood by this registry.
The names preserve registry insertion order and are suitable for editor tooling such as autocomplete.
| void donner::svg::PropertyRegistry::resolveElementColors | ( | ParseWarningSink & | warningSink | ) |
Resolve resource-color overlays and deferred diagnostics before computing inheritance.
Retained non-inline values preserve presentation-attribute fallbacks on inline replacement.
| warningSink | Receives invalid color diagnostics. |
| void donner::svg::PropertyRegistry::resolveFontSize | ( | double | parentFontSizePx | ) |
Resolve font-size from relative units (em, %, ex) to absolute pixels.
Must be called after CSS cascade with the parent's computed font-size, since font-size percentages and em units resolve against the parent (not the viewBox). Also canonicalizes text-indent absolute lengths and computes local em lengths against this element's unadjusted computed font-size, before that value can be inherited. Percentages retain their own-area dependency.
| parentFontSizePx | The parent element's computed font-size in pixels. Use the renderer's initial 12px font-size for the root element. |
| void donner::svg::PropertyRegistry::resolveFontStretch | ( | int | parentFontStretch | ) |
Resolve relative font-stretch keywords (narrower/wider) against the parent's computed font-stretch value.
| parentFontStretch | The parent element's computed font-stretch (as int). Use static_cast<int>(FontStretch::Normal) for root. |
| void donner::svg::PropertyRegistry::resolveFontWeight | ( | int | parentFontWeight | ) |
Resolve relative font-weight keywords (bolder/lighter) against the parent's computed font-weight.
| parentFontWeight | The parent element's computed font-weight (100-900). Use 400 for root. |
| void donner::svg::PropertyRegistry::resolveInsetClipLengths | ( | double | rootFontSizePx | ) |
Resolve supported inset offsets to computed pixels while retaining percentages. Unrepresentable offsets keep an empty clipping region. Call after resolving this element's computed font size, before descendants inherit styles.
| rootFontSizePx | Root element's computed font size in pixels. |
| void donner::svg::PropertyRegistry::resolveTextDecorationThickness | ( | double | rootFontSizePx = 16.0 | ) |
Compute font-relative decoration lengths before a descendant explicitly inherits them.
| rootFontSizePx | Root computed font size for rem units. |
|
friend |
Ostream output operator, for debugging which outputs a human-readable representation of all of the properties.
Example output:
| os | Output stream. |
| registry | PropertyRegistry to output. |
| Property<DominantBaseline> donner::svg::PropertyRegistry::alignmentBaseline |
alignment-baseline property. Specifies how an inline element aligns with its parent's baseline. Uses the same enum as dominant-baseline (baseline parses to DominantBaseline::Auto - both defer to the dominant baseline). Not inherited.
baseline-shift property. Shifts the dominant baseline of the element. Not inherited. "baseline" = 0, "sub"/"super" map to em-relative offsets. Positive = shift up (per CSS). Stored as Lengthd.
| Property<ClipPath, PropertyCascade::None> donner::svg::PropertyRegistry::clipPath |
clip-path property, which determines the shape of the element's clipping region. Defaults to none.
| Property<ClipRule, PropertyCascade::Inherit> donner::svg::PropertyRegistry::clipRule |
clip-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to ClipRule::NonZero.
| Property<css::Color, PropertyCascade::Inherit> donner::svg::PropertyRegistry::color |
color property, which stores the context color of the element. For painting shapes, use stroke or fill instead.
| Property<ColorInterpolation, PropertyCascade::Inherit> donner::svg::PropertyRegistry::colorInterpolation |
Inherited color-interpolation property. Defaults to sRGB; used by luminance masks.
| Property<ColorInterpolationFilters, PropertyCascade::Inherit> donner::svg::PropertyRegistry::colorInterpolationFilters |
color-interpolation-filters property, which determines the color space for filter operations. Defaults to ColorInterpolationFilters::LinearRGB. Inherited.
| Property<Cursor, PropertyCascade::Inherit> donner::svg::PropertyRegistry::cursor |
cursor property, which defines the mouse cursor to display when hovering over the element. Defaults to an empty image list and CursorType::Auto fallback. Inherited.
| Property<DominantBaseline, PropertyCascade::Inherit> donner::svg::PropertyRegistry::dominantBaseline |
dominant-baseline property, which determines the baseline alignment for text. Inherited (CSS Inline Layout 3). Defaults to DominantBaseline::Auto.
| Property<PaintServer, PropertyCascade::PaintInherit> donner::svg::PropertyRegistry::fill |
fill property, which determines the color of the element's interior. Defaults to black.
| Property<double, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fillOpacity |
fill-opacity property, which determines the opacity of the element's interior. Defaults to 1.0. A value of 0.0 will make the interior invisible.
| Property<FillRule, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fillRule |
fill-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to FillRule::NonZero.
| Property<std::vector<FilterEffect> > donner::svg::PropertyRegistry::filter |
filter property, which determines the filter effect(s) to apply to the element. Defaults to an empty list (no filter). Supports CSS filter function lists like blur(5px) grayscale().
| Property<css::Color> donner::svg::PropertyRegistry::floodColor |
flood-color property, used by filter floods and drop shadows. Only explicit inheritance propagates this color from an ancestor.
| Property<SmallVector<RcString, 1>, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontFamily |
font-family property, which determines the font family for text content. Inherited.
| Property<FontKerning, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontKerning |
font-kerning property. Inherited. auto and normal enable kerning; none disables it.
| Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontSize |
font-size property, which determines the font size for text content. Inherited. Initial value is medium, which maps to the UA default font size (12px).
| Property<std::optional<double>, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontSizeAdjust |
font-size-adjust property. Inherited. An empty value represents the initial none value.
| Property<int, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontStretch |
font-stretch property, which determines the width (condensed/expanded) for text content. Inherited. Stored as the underlying integer of FontStretch for sentinel support. Defaults to FontStretch::Normal (5).
| Property<FontStyle, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontStyle |
font-style property, which determines the style (normal/italic/oblique) for text content. Inherited. Defaults to FontStyle::Normal.
| Property<FontSynthesisSmallCaps, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontSynthesisSmallCaps |
Inherited CSS small-caps synthesis policy; native features remain enabled.
| Property<FontSynthesisStyle, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontSynthesisStyle |
Inherited CSS permission to synthesize an oblique face; native faces remain enabled.
| Property<FontVariant, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontVariant |
font-variant shorthand property (SVG 1.1 subset: normal | small-caps). Inherited. Defaults to FontVariant::Normal.
| Property<int, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontWeight |
font-weight property, which determines the font weight (boldness) for text content. Inherited. Value is a numeric weight (100-900), where 400=normal and 700=bold. The relative keywords bolder/lighter are stored as sentinel values and resolved by resolveFontWeight() during style cascade.
| Property<ImageRendering, PropertyCascade::Inherit> donner::svg::PropertyRegistry::imageRendering |
image-rendering property. Selects smooth, crisp, or two-stage pixelated sampling. Inherited.
inline-size property (SVG2). When set to a positive length on a <text> element it establishes an automatic wrapping area whose measure (extent in the inline axis) is the given length; text greedily wraps to that measure. Not inherited. The initial value 0 means "no wrapping area" (the text behaves as ordinary single-line SVG text).
Uses Donner's current per-line wrapping and text-anchor profile in horizontal and vertical writing modes.
isolation property. Forces creation of a new stacking context. Not inherited. Defaults to Auto.
| Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::letterSpacing |
letter-spacing property, extra spacing between characters. Inherited. "normal" maps to 0. Defaults to 0 (normal).
| Property<css::Color> donner::svg::PropertyRegistry::lightingColor |
Light-source color for diffuse and specular lighting. Only explicit inheritance propagates it.
| Property<Reference, PropertyCascade::Inherit> donner::svg::PropertyRegistry::markerEnd |
marker-end property, which determines the marker to be drawn at the end of the path.
| Property<Reference, PropertyCascade::Inherit> donner::svg::PropertyRegistry::markerMid |
marker-mid property, which determines the marker to be drawn at the middle of the path.
| Property<Reference, PropertyCascade::Inherit> donner::svg::PropertyRegistry::markerStart |
marker-start property, which determines the marker to be drawn at the start of the path.
| Property<Reference, PropertyCascade::None> donner::svg::PropertyRegistry::mask |
mask property, which determines the shape of the element's clipping region. Defaults to none.
mask-type property, which selects how rendered <mask> content becomes coverage. Defaults to luminance and is not inherited.
| Property<MixBlendMode> donner::svg::PropertyRegistry::mixBlendMode |
mix-blend-mode property. Controls how an element composites with its backdrop. Not inherited. Defaults to Normal (SourceOver).
overflow property, which determines how content that overflows the element's box is handled. Defaults to visible.
| Property<OverflowWrap, PropertyCascade::Inherit> donner::svg::PropertyRegistry::overflowWrap |
Inherited emergency line-breaking policy; word-wrap is an alias of this property.
| Property<PaintOrder, PropertyCascade::Inherit> donner::svg::PropertyRegistry::paintOrder |
paint-order property. Controls the order in which fill, stroke, and markers of a shape/text are painted. Inherited. Defaults to fill, stroke, markers.
| Property<PointerEvents, PropertyCascade::Inherit> donner::svg::PropertyRegistry::pointerEvents |
pointer-events property, which determines how the element responds to pointer events (such as clicks or hover). Defaults to PointerEvents::Auto.
| Property<css::Color> donner::svg::PropertyRegistry::stopColor |
stop-color property, used by gradient stops. Only explicit inheritance propagates this color from an ancestor.
| Property<PaintServer, PropertyCascade::PaintInherit> donner::svg::PropertyRegistry::stroke |
stroke property, which determines the color of the element's outline stroke. Defaults to none.
| Property<StrokeDasharray, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeDasharray |
stroke-dasharray property, which determines the pattern of dashes and gaps used to stroke paths.
| Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeDashoffset |
stroke-dashoffset property, which determines the distance into the dash pattern to start the stroke.
| Property<StrokeLinecap, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeLinecap |
stroke-linecap property, which determines the shape of the element's outline stroke at the ends of the path. Defaults to StrokeLinecap::Butt.
| Property<StrokeLinejoin, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeLinejoin |
stroke-linejoin property, which determines the shape of the element's outline stroke in between line segments. Defaults to StrokeLinejoin::Miter.
| Property<double, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeMiterlimit |
stroke-miterlimit property, which determines the limit of the ratio of the miter length to the stroke width. Defaults to 4.0.
| Property<double, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeOpacity |
stroke-opacity property, which determines the opacity of the element's outline stroke. Defaults to 1.0. A value of 0.0 will make the outline invisible.
| Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeWidth |
stroke-width property, which determines the width of the element's outline stroke. Defaults to 1.0.
| Property<TextAnchor, PropertyCascade::Inherit> donner::svg::PropertyRegistry::textAnchor |
text-anchor property, which determines the alignment of text relative to its anchor point. Inherited. Defaults to TextAnchor::Start.
| Property<TextDecoration> donner::svg::PropertyRegistry::textDecoration |
text-decoration-line, which determines decoration lines drawn on text. The text-decoration shorthand also sets it, and the property keeps the shorthand's name. Not inherited. Defaults to TextDecoration::None.
| Property<css::Color> donner::svg::PropertyRegistry::textDecorationColor |
text-decoration-color of decorations originating on this element; not inherited.
SVG 2 (section 11.11) paints a decoration with the fill and stroke of the element that declares it. An unset value (the initial state) keeps that fill; an author-specified color, including currentcolor, replaces the decoration's fill paint and leaves its stroke as SVG 2 defines it.
| Property<TextDecorationStyle> donner::svg::PropertyRegistry::textDecorationStyle |
text-decoration-style of decorations originating on this element; not inherited.
| Property<TextDecorationThickness> donner::svg::PropertyRegistry::textDecorationThickness |
CSS thickness of decorations originating on this element; not inherited.
| Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::textIndent |
CSS text-indent: inherited first-line start margin in a fixed inline-size text area. Absolute lengths and em compute to pixels; percentages resolve against this text area's inline measure. hanging, each-line and other relative units are not supported.
| Property<TextOrientation, PropertyCascade::Inherit> donner::svg::PropertyRegistry::textOrientation |
text-orientation property, controlling glyph orientation in vertical text. Inherited.
| Property<TextTransform, PropertyCascade::Inherit> donner::svg::PropertyRegistry::textTransform |
Supported inherited CSS text-transform operation; defaults to none.
| Property<TransformOrigin> donner::svg::PropertyRegistry::transformOrigin |
transform-origin property, which sets the origin for transformations.
| Property<VectorEffect> donner::svg::PropertyRegistry::vectorEffect |
vector-effect property, which modifies how the element is affected by coordinate system transformations. Not inherited per spec. Defaults to VectorEffect::None. Only VectorEffect::NonScalingStroke is honored during rendering.
| Property<Visibility, PropertyCascade::Inherit> donner::svg::PropertyRegistry::visibility |
visibility property, which determines whether the element is visible. Set to Visibility::Hidden to hide the element. Compared to display with Display::None, hiding the element will not remove it from the document, so it will still contribute to bounding boxes.
| Property<WhiteSpace, PropertyCascade::Inherit> donner::svg::PropertyRegistry::whiteSpace |
CSS white-space collapsing and wrapping policy, inherited by text descendants.
| Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::wordSpacing |
word-spacing property, extra spacing between words (U+0020 space characters). Inherited. "normal" maps to 0. Defaults to 0 (normal).
| Property<WritingMode, PropertyCascade::Inherit> donner::svg::PropertyRegistry::writingMode |
writing-mode property, controlling text flow direction. Inherited.