renderdiag

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package renderdiag defines source-free document rejection diagnostics shared by render adapters and the manager. It has no renderer or device dependency.

Index

Constants

This section is empty.

Variables

View Source
var ErrRejected = errors.New("render: document rejected")

Functions

This section is empty.

Types

type Code

type Code uint16

Code values 1–10 match the stable local BZE1 CSS diagnostic contract.

const (
	InputLimit       Code = 1
	TokenLimit       Code = 2
	NestingLimit     Code = 3
	DeclarationLimit Code = 4
	NonFiniteNumber  Code = 5
	Syntax           Code = 6
	UnknownProperty  Code = 7
	InvalidValue     Code = 8
	InvalidSelector  Code = 9
	UnsupportedRule  Code = 10
	// InvalidDocument is adapter-local, never accepted as a BZE1 wire code.
	InvalidDocument Code = 11
)

type Error

type Error struct {
	Code    Code   `json:"code"`
	Source  Source `json:"source"`
	Element uint32 `json:"element"`
	Start   uint32 `json:"start"`
	End     uint32 `json:"end"`
}

Error describes one CSS source in canonical document order, including implied html/head/body elements. Start/End are decoded CSS UTF-8 byte offsets, not HTML offsets. Never retain source text, URLs or an upstream parser error here.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Source

type Source string
const (
	Inline     Source = "inline"
	Stylesheet Source = "stylesheet"
	HTML       Source = "html"
)

type Warning

type Warning struct {
	Code    WarningCode `json:"code"`
	Element uint32      `json:"element"`
}

Warning is bounded source-free evidence about a successfully rendered scene. Rejections use Error instead; callers can never mistake a partial failure for a successful target just because it has warnings.

type WarningCode

type WarningCode string
const (
	Clipped         WarningCode = "clipped"
	MissingGlyph    WarningCode = "missing-glyph"
	ReservedOverlap WarningCode = "reserved-overlap"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL