Repository navigation
fix: preserve native-anchor motion credit through CSS rollbacks - #4503
Merged
Merged
Conversation
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
This was referenced Oct 27, 2026
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
marked this pull request as ready for review
October 29, 2026 11:22
This was referenced Oct 30, 2026
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]>
This was referenced Nov 4, 2026
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]>
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.
The shift watch treated
all: revert-layeras 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 distinguishautofrom 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