NativeElixirPdfUtilities.Validators.HtmlValidator (native_elixir_pdf_utilities v1.1.0)
View SourceNative HTML validation, stage input contracts and shared resource accounting.
Rendering stages use this internal validator as the source of truth for
admitted structures and budgets. Applications should use NativeElixirPdfUtilities.HtmlToPdf.
Summary
Types
Canonical document canvas decision from computed root/body styles.
Functions
Returns comment-normalized CSS and byte gaps for mapping spans to the authored source.
Returns CSS lexical units with quoted strings and escapes kept opaque for component parsing.
Decodes the contents of an already validated CSS string token.
Resolves applicable editing keywords; non-root foreign elements stop editing inheritance.
Returns static popover box defaults without inferring activation or top-layer state.
Prepares iframe dimensions and legacy border suppression before author CSS.
Internal resolution of an already validated styled tree's canvas plan or legacy body-only canvas before allocation.
Normalizes comments without joining CSS tokens; syntax mode retains non-whitespace boundaries.
Parses balanced CSS variable references and fallback dependencies without substitution.
Parses HTML's permissive list-of-floating-point-numbers microsyntax using the shared scalar parser.
Parses a legacy browser attribute using its fixed signed 32-bit conversion invariant.
Prepares source length grammar with symbolic unit and percentage dependencies, without measured scales.
Prepares variable syntax and source dependencies without substituting an inherited value.
Internal canvas selection from computed CSS styles; a painted root keeps body paint on its own box.
Prepares validated page geometry and margins for a styled document and layout options.
Releases the exact DOM validation memo after its style preparation has completed.
Checks authored control content or the initial DOM after selected-content copying.
Validates the canonical positive orphan and widow counts carried by one source paragraph.
Validates a prepared CSS size expression using the shared numeric, depth and work bounds.
Types
Canonical document canvas decision from computed root/body styles.
@type image_budget() :: :atomics.atomics_ref()
Functions
@spec css_comment_projection(String.t(), :syntax | :value) :: {String.t(), [{non_neg_integer(), non_neg_integer()}]}
Returns comment-normalized CSS and byte gaps for mapping spans to the authored source.
Returns CSS lexical units with quoted strings and escapes kept opaque for component parsing.
Decodes the contents of an already validated CSS string token.
@spec html_editing_state(map()) :: :editable | :not_editable | :inherit
Resolves applicable editing keywords; non-root foreign elements stop editing inheritance.
Returns static popover box defaults without inferring activation or top-layer state.
@spec iframe_hints(term()) :: {:ok, map()} | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Prepares iframe dimensions and legacy border suppression before author CSS.
@spec layout_canvas(NativeElixirPdfUtilities.HtmlToPdf.Style.styled_tree()) :: {:ok, document_canvas()} | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Internal resolution of an already validated styled tree's canvas plan or legacy body-only canvas before allocation.
Normalizes comments without joining CSS tokens; syntax mode retains non-whitespace boundaries.
@spec parse_css_variable_references(String.t()) :: {:ok, [map()]} | :error | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Parses balanced CSS variable references and fallback dependencies without substitution.
Parses HTML's permissive list-of-floating-point-numbers microsyntax using the shared scalar parser.
Parses a legacy browser attribute using its fixed signed 32-bit conversion invariant.
@spec prepare_css_length_source( String.t(), :nonnegative | :margin | :length | :signed_length ) :: {:ok, map() | :auto} | :error | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Prepares source length grammar with symbolic unit and percentage dependencies, without measured scales.
@spec prepare_css_variable_source(String.t(), :atomics.atomics_ref()) :: {:ok, [map()]} | :error | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Prepares variable syntax and source dependencies without substituting an inherited value.
@spec prepare_document_canvas(map() | nil, map() | nil) :: document_canvas()
Internal canvas selection from computed CSS styles; a painted root keeps body paint on its own box.
@spec prepare_layout_input(term(), term()) :: {:ok, %{ page_size: {number(), number()}, margins: NativeElixirPdfUtilities.Validators.PageGeometryValidator.margins() }} | {:error, atom() | {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Prepares validated page geometry and margins for a styled document and layout options.
@spec release_style_input(map()) :: :ok
Releases the exact DOM validation memo after its style preparation has completed.
Checks authored control content or the initial DOM after selected-content copying.
@spec validate_paragraph_line_counts(term(), atom()) :: :ok | {:error, NativeElixirPdfUtilities.Diagnostics.detailed_error()}
Validates the canonical positive orphan and widow counts carried by one source paragraph.
@spec validate_prepared_css_size(term(), term()) :: :ok | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}
Validates a prepared CSS size expression using the shared numeric, depth and work bounds.