From 76880c005456d6ce540a49794945befbf2e8fc4c Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Sun, 16 Aug 2026 09:42:41 +0200 Subject: [PATCH] fix: let a tap reach the text on a paged document `.odr-page-outer` was `z-index:-1000`, which paints the page and everything in it behind its parent's in-flow content. It looks right, because the backdrop is the propagated canvas background rather than a box over it, but hit testing walks paint order: every tap landed on `.odr-pages`, so no caret appeared and ios never unfolded the keyboard. What the rule was for is the stacking context, which scopes the `z-index:-1` background of a shape to its page; the negative value itself was not. It is now `isolation:isolate`. Rendering is unchanged - both corpora compare identical under `compare-html`. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_0192ViykqXESAC9VM8Pv2R3u --- CHANGELOG.md | 3 +++ src/odr/internal/html/frontend.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 937dc64c..1ff17edc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ The release run heads these entries with the version and opens a fresh - A keyword is found across the spans it happens to be written in — a pdf puts a word in each — and a space matches whichever kind the page carries. It still does not run across a line, a cell or a paragraph. +- A tap on a paged document reaches its text: a negative `z-index` painted the + page behind its container, which took every tap. No caret, and no keyboard on + ios. ## v6.6.0 - 2026-08-14 diff --git a/src/odr/internal/html/frontend.cpp b/src/odr/internal/html/frontend.cpp index 86ab3a8a..67ed2771 100644 --- a/src/odr/internal/html/frontend.cpp +++ b/src/odr/internal/html/frontend.cpp @@ -31,7 +31,10 @@ x-s{display:inline} of that width, so fitting the document to a phone screen leaves a gutter instead of going edge to edge. */ .odr-pages{display:flex;flex-direction:column;align-items:center;gap:16px;padding:16px 0;width:max-content;min-width:100%} -.odr-page-outer{display:flex;margin:0 16px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.5);z-index:-1000} +/* A stacking context, for the shape backgrounds a page holds at `z-index:-1`. + Not a negative `z-index`, which is one too but takes the page out of reach of + hit testing. */ +.odr-page-outer{display:flex;margin:0 16px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.5);isolation:isolate} /* The label is text rather than a `::marker`, which no selection would copy. It hangs into the item's padding so wrapped lines align under the text. */ .odr-list-item{padding-left:2em}