Repository navigation
Let a page wider than the window scroll sideways to its far side - #5120
Merged
Merged
Conversation
Delete the live root's `overflow-x: hidden` (base.css). Since #5049 a page that takes no theme keeps the browser's tables and code blocks, and one wider than the window could not be reached: the root clipped it and the wheel moved the page 0px. The page now pans sideways as on the open web, and `page check --render` still refuses it (`page-scrolls`). The comments that gave the clip as their reason now give the sideways scroll and the gate's refusal. The plain dashboard's `clipped-out` pin lifts, since the root no longer clips the table, and its obstacle is now the gate's refusal alone. A new browser test wheels a no-theme page's wide table to its last column at 390px.
leaf-agent
approved these changes
Nov 3, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 3, 2026
…lls (#5225) A margin row quoting a passage now stands in the root lane wherever the page's own scroll is the only thing moving its words, as rows on whole elements already did, so a script finds the row where it is drawn in the same task as a scroll. Every row is also placed again once a CSS transition or animation that moved its words or its element ends. **What this buys, and what it doesn't.** Real users saw nothing wrong on main. A real tap or click on the marker three frames after a scroll reached it in 12 of 12 runs, and an independent review's recordings show the painted marker within ±1 px of its words on both arms, smooth scroll included. The gain is for scripts, which on main read the row at its old place until the next frame rendered. That includes Playwright's actions: #5120's reviewer saw a tap aimed in that window scroll to the old place and miss. It also covers probes and the suite, and it leaves fewer `position: fixed` carriers on a page. The transition re-placement is a gain for users. A row on an element whose transition moved it 160 px stayed 160 px off on main until some unrelated pass ran, and so did a quoted row in Firefox; both now stand on their words once the transition ends. **Cause.** #3091 put every quoted row in a carrier anchored to its words, so the row would follow words that a box inside the target scrolls. It did that for every passage, including words that only the document scrolls. A carrier takes up a script's scroll only as the next frame renders: css-anchor-position-1 updates anchor positions once a frame. Chromium also caches an `elementFromPoint` answer given in that window, for 23 to 28 more frames. **Change.** `carrierAnchor` takes the passage's words as the row's subject, by the rule rows on elements follow: - A row whose words sit in a pane, an inner scroller, or inside a sticky or fixed box keeps a carrier anchored to its words. - A row under a sticky header the page declares stands in a carrier anchored to the document's first box, as a row on an element does. Pages with such a header, an `lf-tabs` strip for instance, keep every row in a carrier, and this change doesn't reach them. - Every other row stands in the root lane. Rows stand where they stood. On `review-a-plan` at 1440 × 900 and 390 × 844, and `ship-review` and `release-notes` at 1440 × 900, every row's rectangle matches main's. The re-check that already runs, once a frame, when a box inside the page scrolls and when a transition or animation ends asked only whether each row under that box still shows. It now also places a row again when its subject, the words or element it stands by, has moved from where the last pass stood the row by it (`subjectMoved`). The re-check measures that against whatever carries the row, so it covers rows in carriers too. **A trade-off Max may reverse.** In Chromium and WebKit, a carrier anchored to the words carried a quoted row along while a transform moved them. In the root lane the row trails a running transform and lands at its end, as rows on elements always have. The decision and the rejected alternative are recorded in `carrierAnchor`'s comment. Two cases stay off, as rows on elements already are on both arms: - A scroll-driven animation fires no end event. Its quoted row ends 39 px off in Chromium and WebKit until the next pass, where main left it 16 px off. - A Web Animations motion (`element.animate`) fires no end event either, so `subjectMoved` never sees it. In the review, with a held animation in Chromium, main's quoted row followed its words and this branch's stays 160 px off until the next pass, as element rows already do on both arms. `lf-deck` flights land right on both arms only because the deck's put-away step writes a style at the end of the flight, which brings a pass. A quoted row and an element row on the card Back brings in measured the same on both arms, during the flight and at rest, in all three engines. `subjectMoved` also runs in the existing once-a-frame reading of a scroll inside a box, not only when a transition ends. In Firefox, inside a scaled box, that changes what a smooth scroll does. Firefox carries an anchored row by the scroll's layout distance, not the distance the words move on screen. On main the row drifted up to 48 px and was placed once at `scrollend`. Now the re-check finds the words leaving it and places it again during the scroll: 26 passes over 72 frames, the row within 7 px of its words, and no frame over 15 ms on a four-row page. The `scrollend` pass stays, since WebKit is 24 px off without it. By the code's reading, WebKit's measured anchor moves with the words, so its rows still drift until `scrollend`; that is not measured. The stir comment, the `css-anchors.js` header and the scaled-scroll entry in `notes/browser-support.md` now say so. **Evidence.** The scroll measure loads `review-a-plan` at 390 × 844 with touch and reduced motion, and scrolls the marker to a third of the window. It then counts the frames until the marker's box, and a hit test at one point where the marker is drawn, have caught up. 0 means they were right in the task that scrolled. Five runs per cell, main and this branch back to back: | engine | main: box | main: hit test | this branch | | --- | --- | --- | --- | | Chromium 156.0.8078.4 | 2 frames late | 23–28 frames late | 0 for both | | Firefox 157 | 2 | 2 | 0 for both | | WebKit 27.2 | 1 | 0 | 0 for both | The transform measure, at 1440 × 900, is the offset of each row from where a fresh pass stands it, at rest after a 160 px transition. It uses the reviewer's page with its quoted row (`moving`) and element row (`mover`), run with `leaf-dev probe --journey --base=origin/main`: | engine | main: quoted | main: element | this branch: quoted | this branch: element | | --- | --- | --- | --- | --- | | Chromium | 0 | 160 | 0 | 0 | | Firefox | 160 | 160 | 0 | 0 | | WebKit | 0 | 160 | 0 | 0 | During the 500 ms transition, the quoted row in Chromium trailed by up to 160 px on this branch, where main kept it on the words; WebKit and Firefox trailed on both arms. **Tests.** - `test_a_passage_s_row_moves_with_the_page_s_scroll_in_the_task_that_scrolls` scrolls a quoted row into view and reads, in the same task, its offset from its words and whether `elementFromPoint` where it is drawn finds it, for a pin at 390 px and a rail row at 1440 px. On main both cases fail: the box is still 3727 px and 1374 px from its words. - `test_rows_stand_by_words_a_transition_moved_once_it_ends` moves a box 160 px by a CSS transition and reads, two frames after `transitionend`, where the quoted row and the element row stand. On main the element row fails, 160 px off. Without `subjectMoved` both fail. - `test_the_rail_tab_stop_follows_a_carried_row_back_into_view` needs a row that stands in a carrier. ship-review's first row no longer does, so the test now builds one on a line a box scrolls sideways; the behaviour it protects is unchanged. - `notes/browser-support.md` records Chromium's cached `elementFromPoint` answer, with the evidence that real input isn't affected, under "A cached `elementFromPoint` answer in Chromium". Rows in carriers keep it. Ran: - the three tests above against main, the branch without `subjectMoved`, and this branch; - 53 tests in `tests/browser/margin/test_scrollers.py` selected for carriers, panes, passages, code blocks, scaled and widened boxes, sticky cuts and transitions; - 13 tests asserting that a scroll writes nothing or reflows nothing; - 26 more on quoted rows, cards on shipped examples, comment marks and the smoke tests; - `pnpm run test:runtime` (753 passed), `pnpm run build:browser`, `pnpm run check:browser`, and pre-commit on the changed files. Not verified: the iOS simulator; and the journeys tier and corpus render gate, which landing runs. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Nov 5, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 5, 2026
…dow's right edge (#5574) `test_an_obligation_spanning_its_block_is_a_breakout` has failed on main since #5120 because it still expects `clipped-out` on `<div id=sized>`. #5120 deleted the root's `overflow-x: hidden` so a page wider than the window scrolls sideways, and its description says content past the window's right edge is now reported through `page-scrolls`, no longer also as `clipped-out` by the root. `#sized` is `width: calc(100% + 600px)`, so it reaches past the right edge only. That finding went away by design. `#bare` and `#tinted` use negative margins on both sides, so they still reach off the leading edge, which no scroll reaches, and keep `clipped-out`. All three still report `past-column`. This PR drops the stale pin and says in the docstring which boxes are clipped and why. It changes no code and no behavior beyond what #5120 intended. Verified with `uv run pytest --run-main` on that test: it failed on `990cc5f4a`, the same diff as the issue's, and passes with this change. With `browser/base.css` restored to `f69c5e9fe^` (the rule back), the updated test fails again, which ties the dropped finding to that rule. Closes #5489 — automated triage Co-authored-by: leaf-agent <[email protected]>
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.
Since #5049, a page that takes no theme keeps the browser's own tables and code blocks, so one wider than the window no longer scrolls inside its own box. Leaf's root rule
html[data-lf-live] { overflow-x: hidden }(browser/base.css) then stopped the page itself scrolling sideways, and the far side couldn't be reached at all. This deletes the rule. A page wider than the window now pans sideways, as on the open web, andpage check --renderstill refuses it (page-scrolls), so an agent still fixes the overflow before handing the page over.The rule came in when the root became Leaf's document scroller (26feec8), as what was left of the earlier
html { overflow: hidden }from whenbodyscrolled, and #439 carried it into the render-blocking theme. Neither commit gives a reason for the sideways clip.What changed
browser/base.css: the rule is gone. The root's comment now says the root scrolls on both axes and that the gate refuses a page wider than the window.overflow-wrapand the mediamax-widthrules (base.css), the pin count's left placement (annotation-theme.css), the rail carrier's note on the document's sideways scroll (margin-layout.js), and the reading face's header (reading.css). The rules themselves stay, since each still keeps content inside its box. Themargin-layout.jscomment moves the kernel's input hash (dist/kernel/kernel.json).tests/journeys/test_plain_pages.py: the dashboard'sclipped-out <table>pin no longer occurs, because the root no longer clips the table, so it goes. The obstacle is renamedsideways-refusaland names only the gate's refusal.page-scrollsandpast-columnstay pinned.tests/browser/test_render_gate.py:test_a_page_wider_than_the_window_scrolls_sideways_to_its_far_sideserves a no-theme page holding anowraptable at 390px and wheels over the table until its last column is in the window. With the rule restored, it fails: the wheel never moves the page.Behaviour that changed
page-scrolls, and no longer also asclipped-outby the root (the dashboard pin above) or, by the same reading of the root's overflow inreachability.js, asclipped-control. Content carried off the leading edge, which no scroll reaches, is stillclipped-out(test_the_render_gate_tells_what_a_column_loses_from_what_stands_beside_itpasses).Measured
A no-theme page with a wide table. The plain
dashboardfixture, initialized--no-theme --no-packagesand served bybin/leaf server startunder a fresh state home, read byleaf-dev probewith a journey that brings the table into the window, wheels 1000px sideways over it, then returns and presses ArrowRight twelve times. At 390×844 the last column stands at 419–563px and the page overflows by 173px in both versions.After a 173px scroll the last column stands at 246–390px, whole in the window. WebKit under Playwright doesn't scroll for synthetic arrow keys at all: ArrowUp doesn't move it vertically either, in either version. At 1440×900 nothing overflows in either version and nothing moves.
Leaf's own chrome.
scrollWidthcounts overflow underoverflow-x: hiddentoo, so the page's sideways overflow (the gate'srootOverflow) reads the same in both versions; any state above 0 would be one the user can now pan sideways. Across 48leaf-dev stillsstates, each driven by its stills driver on a fresh page — the floating panel and the leaf's menu, margin cards and their replies, the thread view on a phone, Threads, the more menu, page search, the page map, the contents, capture, the phone margin, touch and narrow variants, and pages whose own tables and diagrams scroll sideways — the overflow was 0 in every state that completed: 47 in Chromium, 45 in Firefox and 46 in WebKit.plan-card-besidefails in its driver in all three engines, andtable-scrolled-phonein Firefox; both fail the same way onmain(checked in Chromium and Firefox respectively).live-sample-embedded-phonewas read in Chromium only, since the feature gallery hung Firefox's run. Every margin row ofreview-a-plan, pointed at so it unfolds, at 20 window widths from 390 to 1640px (pins up to 900px, the rail from 1000px), also gave 0 in Chromium and Firefox.Stills.
leaf-dev stillsagainst the merge base for 16 of those states: in every one, the only computed-style difference ishtmloverflow-x: hidden -> auto. Pixels are unchanged except in two states.margin-gallery-phonediffered by an overlay scrollbar's fade and was unchanged on a rerun.plan-thread-phonediffers on both runs: after the stills driver presses the stop thread's marker on a phone, the page stands 421px higher in one version than the other.That scroll comes from Playwright, not from the press. I ran the driver's sequence 25 times on
main(3cbb347) and 25 on this branch, interleaved in one Chromium with the arm order alternating each round, alternating motion settings, and the host's load at 6–7. The page scrolled in 3 of 25 runs onmain(12%) and 8 of 25 on the branch (32%), two-sided Fisher exact p = 0.17. In all 11 runs that scrolled, the page had moved beforepointerdownreached it. Playwright's click scrolls its target into view first, and in each of those runs it read the marker's box at top 2470px, where the marker stood before the driver's scroll. The marker was painted at 281px, so Playwright scrolled 421px toward the stale box. A real tap does no scroll-into-view, and Leaf focuses the marker withpreventScroll, so a user's tap scrolls the page in neither version.The stale box itself is already on
main. In the same sequence without the press, the marker's box andelementFromPointat the place it is painted lagged the scroll in 6 of 12 runs onmainand 4 of 12 on the branch (p = 0.68), for 28–30 frames either way. During that half second, a press where the marker is painted doesn't reach it; whether the paint lags too wasn't checked. The rate at which Playwright's check lands in the lag does depend on the version in this harness: under reduced motion the branch scrolled in 11 of 32 click runs andmainin none (p = 0.0003), while under normal motion it was 3 of 13 each. A test that clicks a margin marker on a phone right after an instant scroll may therefore meet Playwright's scroll more often on this branch. The lag is the defect to fix, and it belongs to its own change.Not measured: frames during motion, and a WebKit keyboard route.
Checks
tests/browser/test_render_gate.py -kover the no-theme breakout table, the root scrollport's sideways room, page overflow beside an authored scroller, the page edge and the too-wide table: 6 passed.tests/journeys/test_plain_pages.py: 9 passed, 3 xfailed with the updated pins. Intests/journeys/test_render_gate.py, the page that scrolls sideways only between viewports, what a column loses, and a box its container clips away: passed.pnpm run check, which includes the runtime's 750 tests and the kernel comparison: passed.uv run pre-commit run --fileson the changed files: passed.