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
StyleSourceAnnotations.h File Reference
#include <cstddef>
#include <string>
#include <string_view>
#include <vector>
#include "donner/editor/AttributeWriteback.h"
#include "donner/editor/FlashDecorations.h"
#include "donner/svg/SVGDocument.h"
#include "donner/svg/SVGElement.h"
Include dependency graph for StyleSourceAnnotations.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::StyleSourceContribution
 One source-backed style contribution and its source-editor annotation metadata. More...
struct  donner::editor::StyleSourceAnnotations
 Source annotations derived from CSS cascade analysis. More...
struct  donner::editor::DetachedStyleSourceContribution
 One annotation contribution detached from a document registry. More...
struct  donner::editor::DetachedStyleSourceAnnotations
 Registry-independent result of a source-only annotation computation. More...

Namespaces

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

Enumerations

enum class  donner::editor::StyleContributionKind {
  StylesheetDeclaration ,
  InlineStyleDeclaration ,
  PresentationAttribute ,
  ReferenceResourceElement
}
 Source contribution kind for editor-side cascade annotations. More...

Functions

StyleSourceAnnotations donner::editor::ComputeStyleSourceAnnotations (svg::SVGDocument &document, std::string_view source)
 Compute source-editor style annotations for document.
DetachedStyleSourceAnnotations donner::editor::ComputeDetachedStyleSourceAnnotations (std::string source)
 Parse source in an isolated document and compute registry-independent style annotations.

Enumeration Type Documentation

◆ StyleContributionKind

Source contribution kind for editor-side cascade annotations.

Enumerator
StylesheetDeclaration 

Declaration inside an authored <style> rule.

InlineStyleDeclaration 

Declaration inside an element style="" attribute.

PresentationAttribute 

SVG presentation attribute on an element.

ReferenceResourceElement 

Non-rendered resource element such as a gradient or filter.

Function Documentation

◆ ComputeDetachedStyleSourceAnnotations()

DetachedStyleSourceAnnotations donner::editor::ComputeDetachedStyleSourceAnnotations ( std::string source)
nodiscard

Parse source in an isolated document and compute registry-independent style annotations.

Intended for background editor work. The returned element locators must be resolved against the current UI document after its source revision is revalidated.

Parameters
sourceComplete SVG source to parse and inspect.
Returns
Detached annotations, or a result with valid == false on parse failure.

◆ ComputeStyleSourceAnnotations()

StyleSourceAnnotations donner::editor::ComputeStyleSourceAnnotations ( svg::SVGDocument & document,
std::string_view source )
nodiscard

Compute source-editor style annotations for document.

This is intentionally read-only: it describes which source style contributions are selected by the cascade but does not modify rendering, CSS state, or DOM state.

Parameters
documentSource-backed SVG document to inspect.
sourceSource text currently synchronized with document.
Returns
Style contribution annotations for the text editor.