Native rich-text style sheets
The native XHTML decoder applies internal style elements to rich-text fields and FDF/XFDF imports, preserving actual computed styles in saved RV and embedded widget appearances
<body xmlns="http://www.w3.org/1999/xhtml">
<style>
.notice { color: #204080; font-size: 14pt }
p > span.urgent { font-weight: bold !important }
</style>
<p class="notice">Review <span class="urgent">today</span></p>
</body>
Style elements use the XHTML namespace and either omit type or specify text/css; media attributes and nested @media groups use the explicit native print/screen profile
Rules support universal and type selectors, case-sensitive class and ID names, compound selectors, descendant, child, adjacent-sibling and subsequent-sibling combinators, and comma-separated selector groups
Namespace selectors
CSS namespace declarations and qualified selectors support named and default namespace URIs, wildcard or empty qualifiers, independent XML prefix scopes and bounded inherited attribute lookup
Attribute and structural selectors
Attribute selectors support presence, equality, whitespace-separated words, hyphen prefixes, ordinary prefixes, suffixes and substrings: [name], [name="value"], [name~="word"], [name|="en"], [name^="pre"], [name$="end"] and [name*="part"]
Attribute values accept quoted strings or CSS identifiers and their escapes; the optional i flag folds ASCII letters only, whilst s and an omitted flag compare case-sensitively
Unprefixed attributes and [|name] match attributes with no namespace URI; [*|name] also matches prefixed attributes with that local name, excluding namespace declarations
Sibling combinators skip non-element nodes and preserve ancestor matching through chained selectors
Structural pseudo classes include :root, :empty, :first-child, :last-child, :only-child, :first-of-type, :last-of-type and :only-of-type
:scope selects the root rich-text element, matching :root because this decoder has no separate caller-specified scoping root
The static profile accepts :hover, :active, :focus, :focus-visible and :focus-within as valid selectors that never match during PDF appearance generation. Their negations and logical or relational combinations retain normal selector semantics, so p:not(:hover) can apply a style whilst p:hover cannot
@supports selector(:hover) and equivalent conditional imports test selector grammar support and evaluate true; this does not create pointer, activation or keyboard focus state. These six pseudo classes take no arguments, so forms such as :focus() remain invalid
The four positional selectors :nth-child(), :nth-last-child(), :nth-of-type() and :nth-last-of-type() accept odd, even, integer positions and An+B formulas with signed decimal coefficients beyond machine-integer ranges, within the configured scan budget
Type positions compare both the element local name and namespace URI; the :empty rule follows Selectors3, so a whitespace text node makes an element nonempty whilst comments and processing instructions do not
:lang() follows the nearest explicit xml:lang or lang value, matches ASCII-insensitively by an exact value or hyphen prefix, and treats an explicit empty value as stopping inheritance
Logical and relational selector lists
:is() and :where() accept comma-separated complex selectors, including descendant and sibling combinators; unsupported branches are ignored and an empty valid list matches no element
:is() uses the greatest argument specificity, including valid arguments that do not match the current element; :where() contributes zero specificity
:not() accepts a nonempty list of complex selectors and matches when none of its arguments match; an invalid argument invalidates the complete selector list
:has() anchors relative selectors to the current element and tests actual children, descendants or following siblings; each relative argument may begin with >, + or ~, followed by further supported combinators
Nested :has() and pseudo elements are unsupported; an invalid relative argument invalidates the complete :has() list, whilst a surrounding forgiving :is() or :where() list may retain its other valid arguments
:not() and :has() use the greatest valid argument specificity, compared by ID count, class/attribute/pseudo count and type count
:nth-child(An+B of selector-list) and :nth-last-child(An+B of selector-list) count only element siblings matching the union of the nonempty complex selector list; the target must itself belong to that union
Filtered positional selectors contribute their own pseudo-class specificity plus the greatest filter specificity; the of keyword accepts CSS identifier escapes and comment boundaries, whilst :nth-of-type() and :nth-last-of-type() retain their unfiltered grammar
p:has(> span.urgent) { color: red }
span:is(.notice, p > .urgent) { font-weight: bold }
span:nth-child(2 of .included, [data-status="ready"]) { color: blue }
CSS comments and identifier escapes are parsed before matching, including one-to-six hexadecimal digits, optional trailing CSS whitespace and supplementary Unicode scalars; zero, surrogate and out-of-range hexadecimal escapes resolve to U+FFFD
Declarations cascade by importance, selector specificity and document source order, followed by inline styles at their corresponding importance; elements inherit computed parent values through the existing property-specific rules
All internal style elements participate before text is consumed, so a style element appearing after its target still applies; style text does not become visible field text
The declaration profile retains font size, weight, style and shorthand, configured family lists, colour, text decoration, alignment, line height and letter/word spacing; length conversion, parent metric struts and supplied font admission follow the existing native rich-text APIs
Saved RV contains computed inline styles and does not depend on the original style elements; repeated equivalent FDF/XFDF imports retain exact committed bytes when no pending graph changes require publication
Native Pascal consumers, Windows file jobs and original V1 callbacks, and Linux JSON/V1 callbacks share the decoder; no public callback record layout changes are required
MaxTotalCodeUnits bounds stylesheet scanning, extracted style text and aggregate expanded declarations; MaxNodes bounds rule count, selector names, aggregate attribute/pseudo conditions, functional selector lists and matching/sorting work, including relative traversal and filtered sibling scans; MaxDepth bounds XML collection, selector parts, nested functions and recursive matching
Cancellation and limit failures retain the decoder's prior output and the import transaction's committed document state; retry uses the same original options and budgets
Invalid or unsupported top-level selector groups are ignored as a whole; forgiving is/where argument lists retain their valid branches; invalid declarations keep the decoder's existing ignore behaviour, and unsupported at-rules are skipped
Import layers, further media features, pseudo elements, additional state pseudo classes and caller-specified scoping roots, tables, images and general CSS layout remain active work
Native form-data interchange · Linux rich callbacks · Windows form-data exchange · Rich run spacing
Caller-supplied external style sheets add linked and recursively imported CSS with resource URI resolution, media conditions and selected stylesheet sets
Native support queries admit @supports groups and supports() imports using the supported declaration and selector profile, with shared bounds and cancellation recovery