API reference

document.cpp · CSS properties

Browse entries grouped by interface file. Expand an entry for declarations, usage and version boundaries.

Read the related guide →

Entries retain declarations and sources. Runtime verification is recorded per entry; internal source candidates are not a promise of SDK delivery.

src/dom/document.cpp
@page content:counter(page)
Partial3.61.7C++ / C / Go / Rust

Replaced with the current page number as a decimal integer starting at 1. Can be concatenated with static strings. The optional style argument is discarded; decimal is always used. Other named counters produce an empty string. Rewriting page counters with counter-reset/increment is not handled.

document.cpp
counter(page) | counter(page, <style>)

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/dom/document.cpp:1775

Report an issue with this entry →
@page content:counter(pages)
Partial3.61.7C++ / C / Go / Rust

Replaced with the total page count generated by FragmentStore, including parity blank pages. Can be concatenated with static strings. The optional style argument is discarded; decimal is always used. Other named counters produce an empty string. Rewriting page counters with counter-reset/increment is not handled.

document.cpp
counter(pages) | counter(pages, <style>)

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/dom/document.cpp:1775

Report an issue with this entry →
@page margin-box 装饰
Partial3.61.7C++ / C / Go / Rust

Separately uses rectangular backgrounds, solid borders on four sides, and padding. none/hidden sides are not painted. dashed/dotted/double/groove/ridge/inset/outset are all painted as solid strips. Backgrounds are flat colors, without the multilayer image/gradient backgrounds of ordinary DOM boxes. currentColor has no parent inheritance, and borders fall back to black. The default em/rem base for padding is 0. Do not claim the complete units or decoration behavior of an ordinary CSS box.

document.cpp
padding[-top|-right|-bottom|-left]; border[-side][-width|-style|-color]; background-color | background:<flat-color>

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/dom/document.cpp:2201

Report an issue with this entry →
@page margin-box 字体与排版
Partial3.61.7C++ / C / Go / Rust

Reads the margin rule directly, with defaults of sans-serif, 10pt, black, and weight 400. Ordinary DOM ancestor style inheritance does not apply. readLengthPt recognizes pt/px/em/rem/in/mm/cm, but em/rem use the supplied default value; the padding default is 0. Unknown units return the original number in points. backend.computeWrappedLines wraps text. Line height is fixed at font-size times 1.2. Text is vertically centered and switches to top alignment on overflow. The full paragraph behavior of line-height/vertical-align/white-space and related properties is not used.

document.cpp
font-family; font-size:<length>; font-weight:normal|bold|lighter|100..900; font-style:normal|italic|oblique; color:<color>; text-align:left|center|right

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/dom/document.cpp:2103

Report an issue with this entry →
@page margin-box content
Partial3.61.7C++ / C / Go / Rust

Uses a separate tolerant scanner. Quoted text and an escaped next character are preserved; inter-token whitespace and separating commas are not output. Other unknown content is copied character by character. There is no full generated-content parsing for attr()/url()/image/string()/element()/target-counter()/quotes. The support of ordinary DOM content cannot be assumed here. No dedicated suppression branch was found for none/normal, which may be treated as text.

document.cpp
<string> | counter(page[, <style>]) | counter(pages[, <style>]),可相邻拼接

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/dom/document.cpp:1742

Report an issue with this entry →
@page margin-box width/height
Partial3.61.7C++ / C / Go / Rust

Reads only the strip main axis: width for top/bottom boxes and height for left/right boxes. General CSS min/max/percentage sizing is not supported. readLengthPt uses a default of -1 for em/rem, so they cannot produce a positive size. Percentages and other unknown units fall back to a bare point value. The width:50% comment is not evidence of percentage support. Corner boxes always use the margins and do not read explicit width/height.

document.cpp
上/下边盒 width:<length>;左/右边盒 height:<length>;省略视 auto

Historical audit version: 3.59.0 · 2026-11-01 Asia/Shanghai (UTC+08:00)

Verification scope

Imported static source audit from 2026-11-01 / 3.59.0. References are available; this is not a fresh runtime verification of this release.

src/dom/document.cpp:1851

Report an issue with this entry →
Browse this reference type →