NativeElixirPdfUtilities.Validators.CssTransformValidator (native_elixir_pdf_utilities v1.1.0)

View Source

Canonical static CSS affine transforms, measured origins and paginated paint scopes.

Summary

Functions

Prepares transform declarations while deferring used border-box percentages and selected font units.

Attaches an actual element paint scope after used size and positioned child placement.

Retains parent metrics only when an authored transform or origin can need explicit inheritance.

Records the actual used element border box before ordinary relative placement.

Materializes actual paginated CSS paint scopes without changing their source flow or point coordinates.

Retains the selected computed font and viewport metrics for explicit CSS inheritance.

Parses a CSS 2D transform function list through shared CSS lexical and numeric grammar.

Prepares transform-origin through the shared CSS position grammar, with an optional nonpercentage Z length.

Issues one measured paint scope for an actual source box, including shared table row groups.

Resolves a prepared CSS transform against the actual point border box and selected font/viewport metrics.

Checks caller-supplied prepared style transforms using the canonical function and position validators.

Validates retained transform scopes and their containing clips before pagination consumes them.

Checks retained CSS transform paint scopes through the shared geometry and depth bounds.

Functions

apply(style, property, value)

@spec apply(map(), String.t(), String.t()) ::
  {:ok, map()} | :error | {:error, {atom(), map()}}

Prepares transform declarations while deferring used border-box percentages and selected font units.

attach_scope(style, boxes)

@spec attach_scope(map(), [map()]) :: {:ok, [map()]} | {:error, {atom(), map()}}

Attaches an actual element paint scope after used size and positioned child placement.

inherited_metric_style(style, property)

@spec inherited_metric_style(map(), String.t()) :: map() | nil

Retains parent metrics only when an authored transform or origin can need explicit inheritance.

mark_border_box(style, boxes, bounds)

@spec mark_border_box(map(), [map()], map()) :: [map()]

Records the actual used element border box before ordinary relative placement.

materialize(pages, opts, context \\ NativeElixirPdfUtilities.HtmlToPdf.ResourceContext.current())

@spec materialize([map()], keyword(), term()) ::
  {:ok, [map()]} | {:error, {atom(), map()}}

Materializes actual paginated CSS paint scopes without changing their source flow or point coordinates.

metric_style(style, property)

@spec metric_style(map(), String.t()) :: map()

Retains the selected computed font and viewport metrics for explicit CSS inheritance.

prepare(value)

@spec prepare(term()) :: {:ok, :none | [tuple()]} | :error | {:error, {atom(), map()}}

Parses a CSS 2D transform function list through shared CSS lexical and numeric grammar.

prepare_origin(value, style)

@spec prepare_origin(String.t(), map()) :: {:ok, tuple()} | :error

Prepares transform-origin through the shared CSS position grammar, with an optional nonpercentage Z length.

prepare_scope(style, bounds)

@spec prepare_scope(map(), map()) :: {:ok, map() | nil} | {:error, {atom(), map()}}

Issues one measured paint scope for an actual source box, including shared table row groups.

resolve(style, map)

@spec resolve(map(), map()) ::
  {:ok, tuple() | :none | :empty} | {:error, {atom(), map()}}

Resolves a prepared CSS transform against the actual point border box and selected font/viewport metrics.

valid_style?(style)

@spec valid_style?(term()) :: boolean()

Checks caller-supplied prepared style transforms using the canonical function and position validators.

validate_box_scopes(boxes)

@spec validate_box_scopes([map()]) :: :ok | {:error, {atom(), map()}}

Validates retained transform scopes and their containing clips before pagination consumes them.

validate_scopes(scopes)

@spec validate_scopes(term()) :: :ok | {:error, {atom(), map()}}

Checks retained CSS transform paint scopes through the shared geometry and depth bounds.