public sealed class StyleEngineThe whole styling pipeline, assembled.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The parts are separate because each one is worth testing on its own — the matcher against a brute-force oracle, the cascade against CSS's own ordering rules, the sharing cache against a resolver that does not share. They are also useless separately, and every one of them needs the same four interning tables. This puts them together once.
Three name tables rather than one. Selector names, property names and value texts are different namespaces, and folding them together would make the ancestor bloom's domain include every colour in the stylesheet — a filter over a much larger set of names is a filter that rejects less.
Fields and properties (21)
public int SheetCountHow many stylesheets have been loaded.
public NameTable NamesThe table selector names are interned in.
public NameTable PropertiesThe table property names are interned in.
public NameTable ValuesThe table declaration values are interned in.
public SelectorTable SelectorsThe flat store compiled selectors point into.
public SelectorCompiler CompilerThe ExCSS selector visitor.
public StyleRuleSet RulesThe loaded rules.
public SelectorMatcher MatcherThe selector matcher.
public ComputedStyleCache InterningWhere computed styles are interned.
public InlineStyleStore InlineStylesThe declarations written on elements themselves.
public KeyframesTable KeyframesThe @keyframes rules.
public StyleSheetLoader LoaderThe stylesheet loader.
public StyleResolver ResolverThe cascade.
public StyleTree TreeThe element store.
public Animator AnimationsRuns the transitions and the @keyframes animations.
public MediaConditions ConditionsThe conditional groups the loaded sheets declared.
public MediaScopes ScopesEverywhere the rules are being shown, and what @media answers on each.
public ContainerConditions ContainersThe @container groups the loaded sheets declared.
public ContainerScopes ContainerScopesEvery container chain the document has, and what @container answers in each.
public MediaContext MediaWhat @media is evaluated against for sheets that did not name a context.
public Func<string, string>? PreprocessorA transform every sheet's text goes through on its way to the parser.
Methods (9)
public StyleEngine()Creates an engine with nothing loaded.
public bool SetMedia(MediaContext media)Re-evaluates every @media block against a new primary surface.
public bool SetMedia(int scope, MediaContext media)Tells one surface what it is now, and re-evaluates @media there.
public int Load(string css, StyleOrigin origin = Author, MediaContext? media = null)Loads a stylesheet.
public void Replace(int sheet, string css)Replaces a loaded sheet with new text.
public string SheetText(int sheet)The text a sheet was loaded from.
public void Reload()Rebuilds the rule set from the sheets as they now read.
public InlineStyleId AddInlineStyle(ReadOnlySpan<Declaration> declarations)Records declarations written on an element itself.
public ComputedStyle[] ResolveAll()Resolves every element in the tree, parents before children.
Used by (63, showing 40)
- AccessibilityWiringTestsVixen.Platform.Ui.Tests
- AnimationTestsVixen.Ui.Styling.Tests
- ApplyAtInstallTestsVixen.Ui.Styling.Utilities.Tests
- BridgeFixtureVixen.Ui.Tests
- BuildContextVixen.Ui
- CascadeFixtureVixen.Ui.Styling.Tests
- CascadeOrderTestsVixen.Ui.Styling.Tests
- ChildScopedFamilyTestsVixen.Ui.Styling.Utilities.Tests
- ClassSelectorReachTestsVixen.Ui.Styling.Tests
- CombinatorPairTestsVixen.Ui.Styling.Tests
- CompactionTestsVixen.Ui.Styling.Tests
- CompositionTestsVixen.Ui.Styling.Utilities.Tests
- CompositionTestsVixen.Ui.Tests
- ComputedStyleTestsVixen.Ui.Styling.Tests
- ContainerQueryTestsVixen.Ui.Styling.Tests
- ContainerWiringTestsVixen.Ui.Tests
- DrawListTestsVixen.Ui.Tests
- EmitterTestsVixen.Ui.Markup.Tests
- ForcedColorsTestsVixen.Ui.Tests
- HarnessVixen.Ui.Controls.Tests
- HasInvalidationTestsVixen.Ui.Styling.Tests
- HotReloadHostVixen.Ui.HotReload
- HotReloadWatcherVixen.Ui.HotReload
- HotReloadWatcherTestsVixen.Ui.HotReload.Tests
- IncrementalDocumentTestsVixen.Ui.Tests
- IncrementalRestyleOracleTestsVixen.Ui.Styling.Tests
- InitialValueTransitionTestsVixen.Ui.Styling.Tests
- InlineStyleTestsVixen.Ui.Tests
- MediaContextTestsVixen.Ui.Tests
- MultipleAnimationTestsVixen.Ui.Styling.Tests
- PathTestsVixen.Ui.Tests
- PerSurfaceMediaTestsVixen.Ui.Tests
- ReducedMotionTestsVixen.Ui.Styling.Tests
- RefusalExpiryVixen.Ui.Styling.Utilities.Tests
- RemovalTestsVixen.Ui.Tests
- ReparentTestsVixen.Ui.Tests
- RepositoryScanVixen.Ui.Styling.Tests
- ScopedStyleTestsVixen.Ui.Tests
- ScrollNamesVixen.Ui.Controls
- ScrollViewVixen.Ui.Controls