# HtmlComputedStyleEngine

Lightweight computed-style helper for OfficeIMO conversion diagnostics and contract tests.

Class 

`OfficeIMO.Html`

**Namespace**

`OfficeIMO.Html`

**Assembly**

`OfficeIMO.Html`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[HtmlComputedStyleEngine.cs:474](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.cs#L474)

**Modifiers**

static

Lightweight computed-style helper for OfficeIMO conversion diagnostics and contract tests.

## Inheritance

- object
- HtmlComputedStyleEngine

Filter members 

Show inherited

## Methods

Compute 6 overloads

`public static IReadOnlyDictionary<HtmlElement, HtmlComputedStyle> Compute(string html, HtmlCssMediaContext mediaContext = Screen)` [#](#method-compute-string-officeimo-html-htmlcssmediacontext)

[HtmlComputedStyleEngine.Public.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Public.cs#L10)

Parses bounded HTML and computes styles for matching elements.

Parameters

**html string required**

**mediaContext OfficeIMO.Html.HtmlCssMediaContext = Screen optional**

Returns

`IReadOnlyDictionary<HtmlElement, HtmlComputedStyle>`

`public static IReadOnlyDictionary<HtmlElement, HtmlComputedStyle> Compute(string html, HtmlComputedStyleOptions options)` [#](#method-compute-string-officeimo-html-htmlcomputedstyleoptions)

[HtmlComputedStyleEngine.Public.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Public.cs#L16)

Parses bounded HTML and computes styles with explicit inspection options.

Parameters

**html string required**

**options OfficeIMO.Html.HtmlComputedStyleOptions required**

Returns

`IReadOnlyDictionary<HtmlElement, HtmlComputedStyle>`

`public static IReadOnlyDictionary<HtmlElement, HtmlComputedStyle> Compute(HtmlConversionDocument document, HtmlCssMediaContext mediaContext = Screen)` [#](#method-compute-officeimo-html-htmlconversiondocument-officeimo-html-htmlcssmediacontext)

[HtmlComputedStyleEngine.Public.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Public.cs#L24)

Computes styles from a retained conversion document without reparsing its HTML source.

Parameters

**document OfficeIMO.Html.HtmlConversionDocument required**

**mediaContext OfficeIMO.Html.HtmlCssMediaContext = Screen optional**

Returns

`IReadOnlyDictionary<HtmlElement, HtmlComputedStyle>`

`public static IReadOnlyDictionary<HtmlElement, HtmlComputedStyle> Compute(HtmlConversionDocument document, HtmlComputedStyleOptions options)` [#](#method-compute-officeimo-html-htmlconversiondocument-officeimo-html-htmlcomputedstyleoptions)

[HtmlComputedStyleEngine.Public.cs:32](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Public.cs#L32)

Computes styles from a retained conversion document with explicit inspection options.

Parameters

**document OfficeIMO.Html.HtmlConversionDocument required**

**options OfficeIMO.Html.HtmlComputedStyleOptions required**

Returns

`IReadOnlyDictionary<HtmlElement, HtmlComputedStyle>`

`public static IReadOnlyDictionary<HtmlElement, HtmlComputedStyle> Compute(HtmlDocument document, HtmlCssMediaContext mediaContext = Screen)` [#](#method-compute-officeimo-html-dom-htmldocument-officeimo-html-htmlcssmediacontext)

[HtmlComputedStyleEngine.Public.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Public.cs#L43)

Computes styles keyed by owned nodes from the supplied document snapshot.

Parameters

**document OfficeIMO.Html.Dom.HtmlDocument required**

**mediaContext OfficeIMO.Html.HtmlCssMediaContext = Screen optional**

Returns

`IReadOnlyDictionary<HtmlElement, HtmlComputedStyle>`

`public static IReadOnlyDictionary<HtmlElement, HtmlComputedStyle> Compute(HtmlDocument document, HtmlComputedStyleOptions options)` [#](#method-compute-officeimo-html-dom-htmldocument-officeimo-html-htmlcomputedstyleoptions)

[HtmlComputedStyleEngine.Public.cs:49](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Public.cs#L49)

Computes styles keyed by owned nodes with explicit inspection options.

Parameters

**document OfficeIMO.Html.Dom.HtmlDocument required**

**options OfficeIMO.Html.HtmlComputedStyleOptions required**

Returns

`IReadOnlyDictionary<HtmlElement, HtmlComputedStyle>`

IsApplicableMedia 3 overloads

`public static bool IsApplicableMedia(string mediaText, HtmlCssMediaContext mediaContext)` [#](#method-isapplicablemedia-string-officeimo-html-htmlcssmediacontext)

[HtmlComputedStyleEngine.Media.cs:11](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Media.cs#L11)

Evaluates whether a CSS media query list applies to the requested OfficeIMO media context.

Parameters

**mediaText string required**

**mediaContext OfficeIMO.Html.HtmlCssMediaContext required**

Returns

`bool`

`public static bool IsApplicableMedia(string mediaText, HtmlCssMediaContext mediaContext, double surfaceWidth, double surfaceHeight)` [#](#method-isapplicablemedia-string-officeimo-html-htmlcssmediacontext-double-double)

[HtmlComputedStyleEngine.Media.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Media.cs#L26)

Evaluates whether a CSS media query list applies to a media context and surface size.

Parameters

**mediaText string required**

**mediaContext OfficeIMO.Html.HtmlCssMediaContext required**

**surfaceWidth double required**

**surfaceHeight double required**

Returns

`bool`

`public static bool IsApplicableMedia(string mediaText, HtmlCssMediaContext mediaContext, double surfaceWidth, double surfaceHeight, HtmlRenderMediaFeatures mediaFeatures)` [#](#method-isapplicablemedia-string-officeimo-html-htmlcssmediacontext-double-double-officeimo-html-htmlrendermediafeatures)

[HtmlComputedStyleEngine.Media.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Media.cs#L39)

Evaluates whether a CSS media query list applies to a media context, surface size, and deterministic static device environment.

Parameters

**mediaText string required**

**mediaContext OfficeIMO.Html.HtmlCssMediaContext required**

**surfaceWidth double required**

**surfaceHeight double required**

**mediaFeatures OfficeIMO.Html.HtmlRenderMediaFeatures required**

Returns

`bool`

`public static bool IsApplicableSupports(string conditionText)` [#](#method-isapplicablesupports-string)

[HtmlComputedStyleEngine.Supports.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.Supports.cs#L20)

Evaluates whether a CSS supports condition is active for the OfficeIMO CSS subset.

Parameters

**conditionText string required**

Returns

`bool`

`public static HtmlComputedStyleSummary Summarize(IReadOnlyDictionary<HtmlElement, HtmlComputedStyle> styles)` [#](#method-summarize-collections-generic-ireadonlydictionary-officeimo-html-dom-htmlelement-officeimo-html-htmlcomputedstyle)

[HtmlComputedStyleEngine.cs:474](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Html/Styles/HtmlComputedStyleEngine.cs#L474)

Creates a compact summary from computed style results.

Parameters

**styles System.Collections.Generic.IReadOnlyDictionary<OfficeIMO.Html.Dom.HtmlElement, OfficeIMO.Html.HtmlComputedStyle> required**

Returns

`HtmlComputedStyleSummary`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:3A6A94CF129C61D19A70AA0D5294ACD7C61973ED734815B8010876A3C1071C79 -->
