Skip to content

fix: make the native-anchor watch test inject real movement - #4976

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-4916
Nov 1, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-4916

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

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

The important all rollback cancels the lower-tier case's normal inline margin. Its control stayed at x=350 before and after the fault; macOS correctly omitted it while Linux could pass on a spurious finding. Give the injected margin inline importance in that case and verify actual displacement in every case before judging the watch. The geometry assertion fails with the old injection and all six cases pass with the correction, including at 10x CPU throttling. This preserves #4503's intended independent-offset coverage without changing the watch or page behavior.

Closes #4916
@max-sixty
max-sixty merged commit 9a142d1 into main Nov 1, 2026
5 of 7 checks passed
@max-sixty
max-sixty deleted the fix/issue-4916 branch November 1, 2026 18:59
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.

Native-anchor motion watch misses an independently moved control

2 participants