mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-16 08:06:24 +03:00
The analytic walk skips the contrast check when a url() image layer backs text, so CLI scans, CI gates, and the hook had no answer for image-backed text. Outside a browser there is no CORS and no canvas taint: the static engine now reads the image itself, a local file next to the markup or a base64 data URI, decoded with the pure-Rust image crate, sampled on a fixed 6x6 grid, and measured against the text. Static scans have no layout, so the verdict is coarse by design: the finding fires only when the 90th percentile of the grid fails. Uniform tint washes composite exactly, varying scrims keep the skip, no-repeat icons count as decoration, and a remote URL is never fetched. The cascade carries backgroundRepeat / backgroundSize for the decoration gate, stored beside the background shorthand expansion rather than inside it, because the frozen vectors pin that expansion. Fixture sampled-image-contrast.html with generated PNG, JPEG, WebP, alpha and icon images; goldens recorded for the new cases, and the directory sweeps re-recorded (only the fixture's eight findings moved), noted in tests/oracle/DELTAS.md. Refs #560. AI assistance: Claude Code (Claude Fable 5.1), on maintainer instruction. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
38 lines
1.2 KiB
TOML
38 lines
1.2 KiB
TOML
[package]
|
|
name = "impeccable-html"
|
|
edition.workspace = true
|
|
version.workspace = true
|
|
license.workspace = true
|
|
publish.workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
# Vector dispatcher used by tests/vectors.rs to replay the recorded JS call
|
|
# vectors through the Rust port.
|
|
vectors = ["impeccable-core/vectors"]
|
|
|
|
[dependencies]
|
|
impeccable-common = { workspace = true }
|
|
impeccable-core = { workspace = true }
|
|
impeccable-detect = { workspace = true }
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true, features = ["float_roundtrip"] }
|
|
regex = { workspace = true }
|
|
once_cell = { workspace = true }
|
|
indexmap = "2"
|
|
scraper = { version = "0.27", default-features = false }
|
|
ego-tree = "0.11"
|
|
html5ever = "0.39"
|
|
selectors = "0.38"
|
|
cssparser = "0.37"
|
|
thiserror = { workspace = true }
|
|
# Decoding the background images behind text for the sampled-contrast path
|
|
# (#560): pure-Rust decoders only (the comp crate's set plus `png`), so the
|
|
# wasm `detect` build keeps working and nothing native is linked.
|
|
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "webp"] }
|
|
base64 = "0.22"
|
|
|
|
[dev-dependencies]
|
|
impeccable-core = { workspace = true, features = ["vectors"] }
|
|
impeccable-html = { path = ".", features = ["vectors"] }
|