Repository navigation
Hold the text field's custom state set against WebKit, and correct stale engine claims - #6634
Merged
Merged
Conversation
… covers Every summary and .lf-disclosure-marker already takes list-style: none, and the print reset takes it on a said or echoed offer. Since Safari 18.4 WebKit draws a summary's triangle as a list-item ::marker, as Chromium and Firefox do, so list-style: none hides it in all three engines and the WebKit-only pseudo-element rule matches nothing that draws. Checked 2026-11-20 with a standalone page of six summaries (block, flex, grid; with and without list-style: none): with list-style: none the text starts at the summary's edge in Playwright Chromium 159.0.8154.6, Firefox 159.0 and WebKit 27.2; without it, a marker offsets the text 14 to 17px. .lf-disclosure-marker on a button never had a details marker to hide.
WebKit 27.2 doesn't keep `ElementInternals.states` alive while a script holds only the internals. Once it is collected, `states` reads as a new, empty set: `has` says false for a state the host still matches. The field's overflow write skips any state `has` says is already right, so a state WebKit forgot was never deleted. In the floating panel's field, `:state(more-above)` stayed on a one-line draft after a long one, on main, in a leaf-dev probe of alert-review (the fourth of four shrinks kept it). Chromium 159 and Firefox 159 keep one set. The field now holds the set itself. That fixes every guarded state (`more-above`, `more-below`, `corner-taken`), and the overflow mark becomes a state like the others: #3095 had moved it to `data-lf-overflows` because "WebKit retained the old `:state()` rule", together with the observer fix, without isolating either; this is the cause it saw. Minimal repro, `.tmp/scan/custom_state_identity.py` in the scan worktree: add a state, make garbage for a few turns, compare `has` with `matches(":state()")`. WebKit disagreed by round 2; holding the set kept them together for 40 rounds. Tests: `pnpm run test:runtime` (1078 pass), `pnpm run check:browser`, three floating panel field tests, and the comment box test in Chromium and WebKit.
The preview moved itself to the other side of a hidden sibling whenever a new source came with the words the last one had, to dodge a Firefox bug that stands a popover hidden and shown again in one task by its old source. The note's minimal page still reproduces in Playwright Firefox 157 (build 1555) and 159 (build 1572), but only when the sequence starts in the first few frames after load; started 50 ms or more after load, both stand it by the new source. A preview first shows after a dwell or a Tab, long past those frames. On a Leaf page of two controls named alike, Tab from one to the other and a pointer sliding between them took the corrected path 11 times with the move removed, and the preview stood by the second control in 6 of 6 readings in both builds. The stage loses its mark and open() its two pieces of state; the note records the gap as uncorrected. > _This was written by Claude Code on behalf of max-sixty_
A fixed box anchored to a sticky header, its scroller scrolled past the header's place, stood at the header's unstuck place in Playwright Firefox 155 (build 1543) and 157 (build 1555), 250 px and 400 px off in an inner scroller and in the document, and on the stuck header in Firefox 159 (build 1572), as in Chromium 159 and WebKit 27.2. Leaf carried no correction for it, so the note entry and the header's sentence go. The test of rows on constrained targets gains a Firefox arm, since rows on sticky, fixed and fixed-scroller targets now stand by them there too. It passes on Firefox 157 as well, since the margin's pass places a row again once a scroll renders, so it guards Firefox's rows rather than the gap. > _This was written by Claude Code on behalf of max-sixty_
A fixed box anchored to scrolled content, brought by an instant scroll to a point first hit-tested in the scrolling task, was missed by elementFromPoint at that point for all 30 frames read after in Playwright's Chromium headless shell 156.0.8078.4 (build 1248), and found in the first frame in 159.0.8154.6, as in Firefox 159 and WebKit 27.2. The root lane keeps its other reasons: a carried row's box still reads where the last frame drew it until the next frame, as the anchor positioning spec allows, and Chromium 159 still lays out every shown anchored box on each layout (4.2 ms for 2000 against 0.4 ms hidden). > _This was written by Claude Code on behalf of max-sixty_
The rules letting a stuck head's annotations scroll out with their message waited on @supports (animation-timeline: view()), for Firefox 157, which lacked view timelines. Playwright Firefox 159 (build 1572) supports them and runs the named timeline's exit-crossing range as Chromium 159 does: an annotation stands untranslated at rest, at -20px halfway through the range and -40px past it. The guard is true in all three engines Leaf tests, so dropping it changes nothing there, and the rules lose a level of nesting. > _This was written by Claude Code on behalf of max-sixty_
…s event ends the drag The comment said Chromium ends a drag's selection whenever focus moves during it. On 2026-11-20, in Playwright Chromium 159.0.8154.6 (build 1255), Firefox 159.0 (build 1572) and WebKit 27.2 (build 2388), a tabindex=0 panel blurred or passed to its focusable ancestor a task after its focus, or on a pointermove mid-drag, kept the drag's selection, a click's caret and a double-click's word in every engine. Only a blur inside the focus event the press dispatches ended the drag, in Chromium and WebKit; Firefox kept it even then. Passing a task after the focus for both a mouse press and a tap, one route in place of two, failed on alert-review in Chromium: Playwright's click delivered its release before the task, and the comment bar's stand-down at the release (composing/surface.js, standDown, through closeLayer) published DOM focus on the panel as a return, which cancelled the pass. The release-ordered pass runs first of the press's ends, so the design stays; the comment now names both reasons.
Deleting a state through the new set WebKit hands back after collecting the old one still stops the element matching it (Playwright WebKit 27.2, build 2388, 2026-11-20), so only a write that first asks has() goes wrong. An element that only adds and deletes, as lf-file-editor's comparing state does, needs no hold.
Comments only; no code changes. - lf-suggestion.js: in Firefox 159.0 (build 1572), 500 adds to a highlight of 50,000 ranges took about 0 ms and 500 deletes took 579 ms, so only deletes grow with the highlight. The comment said adds grew too. - text-field.js: Chromium 159, Firefox 159 and WebKit 27.2 all skip `focusin` for a node that passes focus on in its own `focus` handler. The comment named only Chrome and Firefox. - input.js: the leave after every move came from one Firefox 158 process whose mouse tracking went wrong on 2026-10-26; restarting Firefox on 2026-10-27 cleared it, and Playwright's Firefox doesn't do it. The comment now gives the reason the design still holds: a leave can come with the pointer still over Send, so where the pointer is comes from coordinates rather than from enter and leave pairing.
… and focus area Rechecked on 2026-11-20 in Playwright Chromium 159.0.8154.6 (build 1255), Firefox 159.0 (build 1572) and WebKit 27.2 (build 2388). Text only; no code changes. - motion.js no longer names WebKit as lacking intrinsic-size interpolation: WebKit 27.2 reports calc-size() and interpolate-size, Firefox 159 neither. The note on block retirement motion records both. - 'A control's own arrows after focus leaves it' now names Chromium and WebKit: with a capturing keydown listener blurring the control, both checked the next radio, stepped a slider and kept focus on a select; Firefox did none. keyboard/controller.js's header says the same. - 'A landing in a skipped content-visibility: auto box' now names Firefox and WebKit. A minimal page shows Firefox still moving a row inside an undrawn run a frame after the landing, which drawing the run for the jump fixes, and both Firefox and WebKit moving a run's first row even with the run drawn; Chromium held every row. - 'State-preserving content reordering' records that WebKit 27.2 still lacks moveBefore and that Firefox 159 has it, keeping a moved input's focus and caret and a moved iframe's document. No text claimed Firefox lacked it.
The grip a comment box or thread card is carried by wrote "Drag to move" as its title, the one title Leaf's own chrome wrote. browser/AGENTS.md has Leaf's controls declare their words to the preview instead, so the grip declares them as its lfPreview. A pointer resting on the grip now reads Leaf's preview after the 200 ms dwell, below the surface, where it read the browser's own tooltip after about a second. A finger's hold reads the same words as before, which it took from the title. In Chromium's accessibility tree the grip, an unnamed generic box no key reaches, loses its description "Drag to move"; a preview reaches a screen reader only on focus. > _This was written by Claude Code on behalf of max-sixty_
…ark" This reverts commit 6b45931.
This reverts commit 44d36a5.
…a stale Firefox claim Codex's review reproduced the stale source in Firefox 159 and the installed Firefox 160.0.1 a second after load, once the first show was held 500 ms before the hide and show, as a preview's is; the scan's repro had shown it only in the first frames after load. Reran here: Playwright Firefox 159.0 (build 1572) stood the popover 380 px off with or without a read of its box between; Chromium 159.0.8154.6 and WebKit 27.2 stood it by the new source. So the move stays (the earlier commit is reverted) and the note's recheck holds the first show. The view-timeline guard stays too: without it, an engine lacking view timelines runs the card head's animation on the document clock and holds its annotations 40 px up, outside their clip. css-anchors.js no longer gives Firefox's lack of scroll-driven animations as a reason against a translated layer; Firefox 160.0.1 runs a named scroll timeline (Codex's probe). Chrome painting such a layer a frame off its content still rules it out.
The folder guard hid a folder narrower than the font's ellipsis, on the assumption that a box with room for the ellipsis draws one. A box's first character is clipped rather than ellipsed (CSS Overflow, text-overflow), as Firefox draws it: Playwright Firefox 159.0 (build 1572) showed 'skconfig.py' for skills/config.py, cut letters and no ellipsis, for every folder box from 1 to 17 px wide, and 's…' from 18 px. Chromium 159 and WebKit 27.2 draw 's..' there. The hidden measure is now 'm…' (21.6 px in the header's 13 px face against 10.4 px for the ellipsis alone), so a folder shows only with room for a wide letter and the ellipsis; Chromium and WebKit hide a folder from 11 to 21 px that showed 's…'. Found by the stylesheet scan; test_render_diff_controls' path tests pass.
leaf-agent
approved these changes
Nov 21, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 21, 2026
…s baseline audit (#6650) Leaf no longer closes the small baseline gap that centring words of two sizes leaves. Two struts did: a zero-width character with `line-height: 0` beside a message head's name, and one beside a leaf menu row's value. They go, with the `leaf-dev stills` baseline audit that reported every split of a quarter pixel (a 365-line browser script and its plumbing) and the test assertions that held those baselines to a tenth of a pixel. Without the struts the name stands 0.92px lower than the time in Chromium and 0.5px in Firefox at the default size, and the menu value a similar fraction higher than its name. The name's box goes back to `overflow: hidden`; accented capitals and descenders still show whole. `browser/AGENTS.md`, "Layouts, styles and controls", now states the rule: words share a baseline by baseline alignment or a shared face, and a centred row keeps its gap rather than gaining a strut, a short line box or an offset. The message head's header names the layout-only alternative agents reach for (baseline alignment with `flex-wrap: wrap` and `align-content: center`) and why it fails: a narrow head wraps the time below the name. In a scratch A/B, agents given the message head without the rule changed its layout in 3 of 3 runs; with it, 2 of 3 left it alone and none added a strut. Max asked for this after #6634's scan found the struts were precision nobody had asked for. Codex reviewed the branch; its one finding, that the gap isn't bounded by a pixel (1.64px at a 20px root font), is fixed. Tests: `pnpm run check`, pre-commit, the stills model tests, the composing test that held the head's baselines, and Firefox stills and probes of the message head and leaf menu. > _This was written by Claude Code on behalf of max-sixty_
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #6631, Max asked for a scan for other code made more complicated by a mistaken assumption. Four scans checked about 78 engine claims in the runtime, the theme and the packages against Playwright 1.65.2's Chromium 159, Firefox 159 and WebKit 27.2, each with a minimal repro. Nearly all still hold. This change acts on the ones that don't:
data-lf-overflowsbecause "WebKit retains style from a removed custom state". In fact WebKit garbage-collectsElementInternals.states, after whichhas()reads a new, empty set while:state()still matches. The field skips a writehas()says is done, so:state(more-above)stayed on a one-line draft in WebKit on main. The field now holds the set, and the overflow mark is a state again. The new note records the gap.::-webkit-details-markerrules go (Safari 18.4 madesummarya list item), as do two notes entries no code rested on.skconfig.pyforskills/config.pyat folder widths up to 17px. The guard now measures a wide letter and the ellipsis.titleto Leaf's preview, asbrowser/AGENTS.mdrequires. A screen reader no longer hears it as a description; the drag has no keyboard route either way.Codex reviewed the branch and found that two prototypes were wrong: the preview's workaround for Firefox's stale popover source still reproduces once a show is held (Firefox 159 and 160.0.1), and dropping a view-timeline guard would strand annotations in an engine without view timelines. Both are reverted.
Tests:
test:runtime,pnpm run check, pre-commit, the preview, margin and diff path browser tests, the comment box test in Chromium and WebKit, and three floating panel field tests.