Skip to content

Read the hover in the document's own tree, so Firefox captures settle on Web Awesome views and gallery frames - #5438

Merged
max-sixty merged 16 commits into
mainfrom
agent-a9a03e588cab9e626
Nov 5, 2026
Merged

max-sixty merged 16 commits into
mainfrom
agent-a9a03e588cab9e626

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

In Firefox, leaf-dev stills and probe could no longer capture screenshot-pixels. Since #5393 put the shot's views in a Web Awesome radio group, settle's hover wait either hung or timed out there. Both failures came from #5356's hover check, which this fixes.

The hang. The hover check read where the mouse had last moved in each of the page's frames, to tell whether the pointer rested inside a child frame. On the gallery page, with 19 frames, reading an about:blank frame never returned in Firefox. The check no longer visits frames. A mouse inside a child frame shows in the top document as a hovered iframe, so that is what the check now reads, and the per-frame timestamps are gone.

The timeout. The check followed both the hover chain and the element under the pointer down through open shadow roots. In Firefox those disagree inside a Web Awesome radio button: the host is hovered, but the slot under the pointer isn't. So the hover never counted as caught up. The check now compares the two in the document's own tree, where a shadow host stands for everything its shadow root draws. It no longer sees a stale hover that stays inside one host, which no known state needs.

Evidence

  • Bursts of 8 captures 250 ms apart. In each of Chromium, Firefox and WebKit, every one of these states drew one image: screenshot-pixels, screenshot-options, image-preview, film-inspector, activity-feed, plan-capture (button held), diff-file-reply (pointer in a frame) and dynamic-request-preview. retained-quote also drew one image in Chromium and WebKit. In Firefox it fails before capture, and it fails the same way with main's browser.py.
  • The check's own cases, in every engine. A container whose button scrolled out from under the pointer reads as behind in 12 of 12 readings, until the engine moves the hover. A mouse resting in an iframe reads as caught up. After a native drag, the record holds the drop point.

This was written by Claude Code on behalf of max-sixty

…iew prepare, and draw no PhotoSwipe placeholder

Two developer captures changed after the page reported ready, because work the page draws after a gesture ran outside the readiness the runtime declares (rendering.js: finite asynchronous preparation registers `holdRendering` until it commits).

The image viewer loads PhotoSwipe and decodes the image before drawing it. That preparation was unregistered, so `image-preview`'s driver waited on PhotoSwipe's zoom button instead. Opening the viewer now holds rendering until `open` settles, and the driver keeps only its dialog wait. Separately, the 1 s change in that capture was PhotoSwipe's own placeholder: a box sized to the image, sitting behind it with Leaf's `.pswp__img` shadow and outline until PhotoSwipe's 1000 ms `removePlaceholder` timer. Leaf opens PhotoSwipe only after the image has decoded, so the placeholder showed nothing but a doubled shadow; the viewer now asks for none (`useContentPlaceholder`). A user opening an image now sees its final shadow from the start rather than a heavier one for a second.

lf-shot computes its pixel mask after the Pixels view is chosen without presenting it, so `screenshot-pixels` sometimes captured the faded pair before the mask. The mask now goes through the same `present` as the shot's image pair.

Behavior that changed: an opened image's shadow no longer lightens a second after it appears; `lfReadiness` reads `rendering` until the viewer's image or a shot's pixel mask is drawn. The media journey test asserts the viewer's hold.
# Conflicts:
#	packages/default/widgets/lf-shot.js
@max-sixty
max-sixty merged commit 475e9a6 into main Nov 5, 2026
4 checks passed
@max-sixty
max-sixty deleted the agent-a9a03e588cab9e626 branch November 5, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants