Files
cb56ed6c19 Fix: detect placeholder contrast (#790) (#799)
* Fix: detect placeholder contrast (#790)

`detect` never read `::placeholder` color, so pale placeholders passed. Score them with the same WCAG math as body text, without host class/clip heuristics.

Prepared with AI assistance.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix: match descendant ::placeholder hosts (#790)

`.form ::placeholder` kept the ancestor as the host. Reuse the hover combinator star-fill so the color lands on the inputs inside.

Prepared with AI assistance.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix: placeholder-shown and gradient alpha (#790)

Browser scans skip when :placeholder-shown is false, so a live filled field does not keep the HTML value attribute's empty state. Translucent placeholders flatten over each gradient stop before scoring.

Prepared with AI assistance.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix: trailing combinator only for ::placeholder hosts (#790)

`star_empty_compounds` turned `.label + ::placeholder` into `.label *+*`. Fill only a trailing empty compound so adjacent-sibling hosts still match.

Prepared with AI assistance.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-10 13:49:59 -07:00
..

browser-bundle: the page-side JavaScript of the detector

Plain JavaScript that runs inside a page or the extension: the DOM probe the wasm rule core calls back into, the page snapshot producer, the visual-contrast sampling IO, the overlay UI, the scan API and the extension's offscreen document. Measurement and presentation only; every rule decision is a call into the wasm rule core built from crates/core (docs/ENGINE.md).

Two consumers:

  • crates/browser embeds 15-snapshot.js (the snapshot producer the URL engine injects; no WebAssembly runs in the page).
  • crates/bundle (the impeccable-bundle library) embeds every file here with include_str! and concatenates them, in filename order, with the wasm core into the in-page bundle plus the extension's extension/detector/ pieces. cargo xtask bundle is its caller inside this workspace: it writes dist/detect-antipatterns-browser.js, copies that bundle to the tracked crates/live/assets/detect-antipatterns-browser.js the engine embeds, and writes the extension pieces. A downstream crate with its own rule pack calls the library directly (docs/ENGINE.md).

Because the files are embedded, a new one here has to be added to PAGE_JS in crates/bundle/src/lib.rs (and to the order it is concatenated in); a test fails when the two lists disagree.

15-snapshot.js lists the computed-style properties the rules read; the bundle build checks that list against the core's and fails when they drift.