Skip to content

fix: preserve native-anchor motion credit through CSS rollbacks - #4503

Merged
leaf-agent merged 3 commits into
mainfrom
repro/issue-4497
Oct 29, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
repro/issue-4497

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

The shift watch treated all: revert-layer as a competing inset, so the chrome guard from #4480 prevented it from crediting the peek's native-anchor motion. The watcher now checks the inset alternatives a rollback can expose and uses Typed OM to distinguish auto from a resolved pixel position. Panel layout and chrome isolation are unchanged.

The regression fails before the fix with 130px of uncredited anchor movement and passes afterward. Independent-offset controls still report movement when the reset loses, when it removes anchoring, and when an important reset exposes numeric insets from a lower tier. The three reported floating-panel cases reproduced before the fix and pass afterward at 6× CPU throttling. Focused native-anchor and inherited-motion checks pass; Ruff, JavaScript syntax and diff checks pass.

Closes #4497 — automated triage

Extend the native-anchor ownership test with an all: revert-layer reset followed by the anchor rule. The clean reset case fails while the unguarded case and both independent-offset controls pass. This preserves the watcher failure without changing the chrome isolation introduced in #4480.

Refs #4497
Read every possible author inset below a rollback and use Typed OM to distinguish an auto inset from its resolved pixel position. Keep independent-offset controls for a losing reset, a reset that wins, and an important reset that exposes lower numeric insets. This changes watcher attribution, not panel layout or chrome isolation.

Closes #4497
@leaf-agent leaf-agent changed the title test: reproduce lost native-anchor credit after a CSS rollback fix: preserve native-anchor motion credit through CSS rollbacks Oct 29, 2026
@leaf-agent
leaf-agent marked this pull request as ready for review October 29, 2026 11:22
@leaf-agent
leaf-agent merged commit c9c8f4a into main Oct 29, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the repro/issue-4497 branch October 29, 2026 11:47
max-sixty pushed a commit that referenced this pull request Nov 1, 2026
The native-anchor watch regression added in #4503 did not inject
movement in its `lower-True` case: `all: revert-layer !important`
cancels the normal inline margin, leaving the control at x=350 before
and after the supposed fault. The reported macOS failure therefore
asserted a finding for a control that had not moved. Linux passed the
old test despite the same stationary geometry.

The injected margin now has inline importance in that case. Every case
also asserts the control's actual displacement before checking the
watch, preserving both owned anchor travel and independent-offset
coverage. The watch and Leaf's interface are unchanged.

Validation: the new geometry assertion fails against the original
injection (0px instead of 130px). All six cases pass with the
correction, normally and at 10× CPU throttling; Ruff and diff checks
pass. macOS verification will run through a manual `ci` dispatch on this
branch; its result remains pending.

Closes #4916 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 4, 2026
…5298)

The shift watch missed `button#control`'s 130px margin move in
`test_native_anchor_follows_owned_translation_but_not_an_independent_offset[lower-True]`.
It read the important rollback `#tip {all:revert-layer!important}` as a
normal declaration, because Chrome's CSSOM leaves a longhand set only by
an important `all` with an empty `getPropertyPriority` and keeps the
importance on `all`. That left `left:anchor(left)!important` alone in
the important tier, so the watch treated the surface as natively
anchored and credited the control's independent move to the anchor's
equal 130px travel. The watch now takes a declaration's priority from
`all` when the longhand reports none. It reads priority this way in all
four places: rule tiers, important-only filtering, and both inline
checks.

The test setup also hid the miss on Linux. The guard styles were added
after the page presented, and that restyle moved the control (by `[0,
-21]` in `lower`, `[-350, -100]` in `wins`). The watch reports each
moved node once per page, so on Linux that setup report satisfied
`names_move(errors, "button#control")` before the fault ran. On macOS
the setup move fell inside the presentation window, so only the real
miss was left. That is why this case has failed in every scheduled macOS
run since #4503 added it, including after #4976. The guards now sit in
the document's own `<style>`, and the test asserts the watch reported
nothing before the fault.

Verification on Linux, Chrome 156:
- With the restructured test and the old watch, `lower-True` fails with
the same finding the macOS runs show: only `p#trigger` is named. It
passes with the fix.
- All six cases pass.
- The 56 shift-watch tests matching anchor, rollback, layer or
translation pass, both normally and at `--cpu-throttle 10`.

The macOS job runs only on schedule or dispatch, so the next scheduled
`test-macos` run is what confirms it there. The change touches only test
instrumentation; Leaf's runtime and interface are unchanged.

Closes #4916 — automated triage

Co-authored-by: leaf-agent <[email protected]>
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.

Folded panel peek reports uncredited movement during three browser tests

1 participant