RFDs/0009

Enhanced EPUB rendering

State
published
Authors
Shōsai contributors
Discussion
chaba-dev/shosai#22
Labels
shosaiepubrenderingsecurityperformance
Implemented
88%Checklist

Goal

Improve EPUB CSS, table, embedded-font, MathML, navigation, and fidelity without weakening Shōsai’s native reading experience or growing an unbounded browser implementation.

Decision

Shōsai expands its native parser, computed-style, layout, shaping, and Iced presentation rather than embedding an operating-system webview. The Wry spike showed useful rendering fidelity, but cannot support native Wayland child embedding in the current host and adds platform runtime, packaging, lifecycle, input, accessibility, and security variance.

The native route uses bounded archive/resource admission, a book-local resource model, shared parsed chapter presentation, stable logical locations, native font shaping and rasterization, semantic table lowering, and a bounded MathML subset with readable fallback. Network loading and script execution remain disabled.

Boundaries

The implementation supports a documented EPUB subset rather than attempting a general browser engine. Unsupported CSS and MathML degrade predictably. Resource limits apply before backend allocation, and warm navigation must avoid parsing, repagination, decoding, and synchronous storage.

The complete spike, trade-off, benchmark, and platform evidence is retained in the EPUB renderer decision evidence.

Frontend evolution

In this RFD, “native” selects Shōsai’s bounded parser, resource policy, computed presentation, stable locations, shaping, and layout over an operating-system webview. It does not require Iced to remain the product frontend forever. The Iced implementation and measurements remain evidence for the published renderer decision.

RFD 12 moved the EPUB engine to Dart (shosai_epub, adopted 2026-09-28) and, on 2026-10-21, the whole application core with it. Those decisions supersede the Iced and Rust presentation boundaries without reopening this RFD’s no-script, no-network, bounded-resource, or native-layout decisions. The Dart engine is the one EPUB parser and must preserve the semantic fixtures, stable locations, fallback behavior, and performance budgets recorded here; the Rust renderer’s fixtures and measurements remain the evidence it is held to.

Implementation

Progress and remaining cross-platform acceptance evidence are tracked in RFD 9 implementation checklist.