Repository navigation
Guard the floating editor's dropped scroll padding with a test that fails without it - #5589
Merged
Merged
Conversation
…ll matters The root drops its scroll padding while the user writes in a floating box (base.css, data-lf-floating-editor), because Chromium and WebKit reveal a caret in a box anchored to the page by scrolling the page and count that padding. The test #4833 left for it, test_a_card_at_the_windows_foot_grows_back_to_how_it_stood, now passes with the rule removed: its card stands in the window's plane, which names no position-anchor, and both engines stop a reveal at a fixed box with no anchor. #5580's test proves the toggle restyles only the chrome, not that it keeps the words still. So nothing failed without the rule. The new test types into a comment box standing over the panel's band at the window's foot. With the rule removed it fails in Chromium 156 (the words move 16 px) and WebKit 27.2 (14 px); with the rule as a plain zero and in the calc(0 * var(--lf-landing-top)) form #5580 landed, it passes in both. The browser-support note records a Chromium gap found on the way: reveals of an anchored fixed box made before the next frame each scroll the full amount again (three scrollIntoView calls scroll 270 px rather than 90), which is the overshoot #5417 accepted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o, and why nothing else does The rule's comments named Chromium alone. Playwright WebKit 27.2 moves the document under a comment box at the window's foot as Chromium 156 does (14 and 16 px for one key; 58 and 221 px over a growing comment), and the rule keeps both still; Firefox 157 reveals no caret through a fixed box. The comment now records the alternatives measured against a plain anchored contenteditable and in Leaf's own boxes, all of which left the reveal reaching the page in Chromium, WebKit or both: the field or the box as its own scroll container, overflow clip, contain (layout paint; strict only stopped the box following its anchor), overscroll-behavior, a popover in the top layer, scroll-margin on the caret's text (Chromium honors it, WebKit applies none to a caret's reveal), and taking typing in beforeinput (WebKit still reveals). Both engines reveal through the box's anchor by design: Blink's IsFixedToFrame skips a box with an anchor scroll adjustment (crbug.com/469481151, WPT css-anchor-position/scroll-to-anchored-fixed-*), and WebKit's adjustForScrollByAnchor does the same. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rd test's docstring to what it holds #5576 replaced `leaf-dev scaling` with `leaf-dev bench`, so base.css now names the command the 256-section asks page comes from. The guard test's docstring states the box over the foot band, the engines' reveal counting the padding, and the rule it guards. How the failure was found stays here: with the rule's declaration replaced by a comment, typing four keys into that box moved the words 16 px in Chromium 156 and 14 px in WebKit 27.2 (21 px in WebKit when both engines ran at once), and each line that grew the box further down the window moved them again (221 px and 58 px over fourteen lines from words 500 px down an 860 px window). Firefox 157 reveals no caret through a fixed box. Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
approved these changes
Nov 6, 2026
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.
While the user writes in a floating comment box, the root drops its scroll padding (
data-lf-floating-editor,browser/base.css), because the browser's caret reveal through a box anchored to the page applies that padding and moves the words beneath a box already in view (#4821). Nothing in the suite failed with that rule removed: #4833'stest_a_card_at_the_windows_foot_grows_back_to_how_it_stoodstands its card in the window plane, which writes noposition-anchor, so the reveal stops at the box there. This adds a test that does fail, and records why the rule has no structural replacement.test_writing_in_a_comment_box_over_the_window_foot_moves_no_words(tests/browser/test_chrome_contracts.py, Chromium and WebKit) opens a comment box on words low in a 1512×860 window, so the box stands over the foot band the panel states, types four letters, and asserts the page didn't scroll. It also asserts the caret stands inside that band, so a layout change that moves the box clear of it fails the test rather than passing it vacuously. With the rule's declaration removed, the words move 16 px in Chromium 156 and 14–21 px in WebKit 27.2.IsFixedToFrame,scroll_into_view_util.cc); since crbug.com/469481151 an anchored fixed box bubbles to the root and takes its padding, pinned by WPTcss-anchor-position/scroll-to-anchored-fixed-001…006. WebKit does the same (adjustForScrollByAnchor,LocalFrameView.cpp). Firefox 157 reveals nothing through a fixed box. An agent tried, on a plain anchored contenteditable and in Leaf: the field or the box as its own scroller,overflow,contain,overscroll-behavior, the top layer (popover),position: absolute,scroll-marginon the caret's text, and taking typing inbeforeinput. Each either still moved the page in Chromium or WebKit, or stopped the box following its anchor. The comments inbase.cssandfloating.jsnow name WebKit and say what was rejected.notes/browser-support.mdrecords a Chromium bug found on the way: each reveal of an anchored fixed box made before the next frame scrolls the full amount again (threescrollIntoViewcalls scroll 270 px where one scrolls 90; four keys in one frame 240 px where one scrolls 60). WebKit reveals once. It is the overshoot Keep landings clear of the chrome while a floating editor holds focus #5417 accepted, and the note gives the check that shows when Chromium fixes it.leaf-dev bench, which replacedleaf-dev scalingin Measure every page and input with one leaf-dev bench, in place of scaling and bench-latency #5576.Checked: the new test passes on both engines at the head and fails on both with the rule's declaration removed (Chromium 2076 → 2092, WebKit 2075 → 2096, rerun independently); #5580's restyle test passes; pre-commit on the changed files.