Skip to content

assert_not_occluded abstains on WebView2/high-DPI — needs DPI-correct hit-test or CDP z-order #40

Description

@CameronCrow

Finding (from the 2026-07-23 LLT vision dogfood)

vision.assert_not_occluded (and therefore assert_visible) abstains on the real LLT Import UI (WebView2 / Chromium, high-DPI) rather than deciding occlusion. Two reasons, both real:

  1. touchpoint.element_at is coordinate/DPI-unreliable on WebView2. Hit-testing the button's centre (447, 679) returned a role=group element from a different Chromium process whose bounds (959, 606, 1152, 637) do not even contain the queried point. A trustworthy hit-test returns the element at the point; this doesn't. assert_not_occluded now detects "hit rect doesn't contain the point" and abstains (trust guard).
  2. Wrapper ambiguity. When the hit does land on the point, it's often an owned/same-process DOM wrapper that encloses the button — indistinguishable by geometry from a real same-window overlay, and element IDs churn across touchpoint reads so we can't chain ancestry. → abstain.

What DOES work reliably today: a foreign-process window painted over the element (an OS dialog, another app) → hard fail. That's the unambiguous, high-value case and it's kept.

What robust occlusion needs

  • DPI-correct hit-testing: reconcile the coordinate space touchpoint reports element rects in vs. what element_at expects (physical vs logical pixels). May be an upstream touchpoint issue.
  • DOM z-order via CDP (overlaps robustness: React/div-soup apps expose thin a11y trees — make verification robust to them #37): for same-window web overlays, a CDP query (elementsFromPoint / z-index / checkVisibility()) decides "is our node actually the top paint at this point" far more reliably than a native hit-test. This is the real fix for WebView2/Electron/Chromium.

Acceptance

  • On a WebView2 app with a known DOM overlay over a button, assert_not_occluded FAILS (not abstains); with no overlay it PASSES (not abstains).
  • Never false-passes an actually-covered element.

Non-web/native occlusion already works; this is specifically the embedded-web + high-DPI gap. Discovered by assert_not_occluded abstaining honestly rather than lying — the safety property holding.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions