Skip to content

fix: read an important all rollback as important in the shift watch - #5298

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4916-all-priority
Nov 4, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-4916-all-priority

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

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

Chrome's CSSOM reports a longhand set only by `all: … !important` with an
empty priority and keeps the importance on `all`. The shift watch read
`#tip {all:revert-layer!important}` as a normal declaration, so the
important tier held only `left:anchor(left)!important`, and it credited the
control's independent 130px margin move to the anchor's equal travel.

The native-anchor test's `lower` and `wins` guards were added by restyling
the surface after it presented. That restyle moved the control on Linux,
spending the watch's one report for it before the fault, so Linux passed
on the setup move while macOS, where that move fell in the presentation
window, exposed the miss. The guards now stand in the document, and the
test asserts the watch reported nothing before the fault.

Closes #4916
@leaf-agent
leaf-agent merged commit 0c3869f into main Nov 4, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4916-all-priority branch November 4, 2026 06:53
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

1 participant