Skip to content

The design language that makes your AI harness better at design.

JavaScript

URL scans hide a site's own cookie notice, splash gates and slow intros (#1106)

Paul Bakaus2fd24e3a9887
diff --git a/crates/browser/src/consent.rs b/crates/browser/src/consent.rs
index 2b8be6a3e..6118e6f96 100644
--- a/crates/browser/src/consent.rs
+++ b/crates/browser/src/consent.rs
@@ -5,15 +5,24 @@
//! or scored against the banner, and the crops show the banner instead of the
//! page. Before the reveal sweep the URL engine hides the banners and
//! backdrops of the consent managers listed here with an injected style
-//! (`display: none`), and undoes the scroll lock the manager applied. It never
-//! clicks, sets a cookie, or records a consent choice: the page's own state is
-//! unchanged, only painted without the manager's layer.
+//! (`display: none`), and a site's own cookie notice with an inline one, and
+//! undoes the scroll lock or blur they applied. It never clicks, sets a
+//! cookie, or records a consent choice: the page's own state is unchanged,
+//! only painted without the notice's layer.
//!
//! The list holds selectors specific to one vendor (its ids, or class names
-//! carrying its name), never a generic word such as "cookie" or "banner", so
-//! a notice a site wrote for itself stays on the page and is scanned like the
-//! rest of it. The validity gate ([`crate::validity`]) reads the same list to
-//! recognize a page that is nothing but a consent wall.
+//! carrying its name), never a generic word such as "cookie" or "banner".
+//! The validity gate ([`crate::validity`]) reads the same list to recognize
+//! a page that is nothing but a consent wall.
+//!
+//! A cookie notice a site wrote for itself is recognized by what it does
+//! rather than by its names ([`cookie_notice_js`]): a fixed or page-covering
+//! layer whose own text names cookies and which offers a consent choice, with
+//! no field to fill in. Corpus run 1006 found three (blueeyes.com.tw,
+//! searchvoro.com, ktk.de) covering about 40 findings and blurring one whole
+//! site. This reverses the decision recorded below for moe.gov.sa's
+//! `div.cookie-consent` (runs 42 and 43), which stayed because nothing in its
+//! markup told it apart from any other dialog: its text and its choice do.
//!
//! Corpus evidence (runs 20 and 25, 848 captures of 126 sites, desktop and
//! 390px): OneTrust on 7 sites (adm.com, cisco.com, cvs.com, exxonmobil.com,
@@ -53,6 +62,11 @@
//! `div.cookie-consent`, an Alpine.js dialog) stays: nothing in its markup
//! tells it apart from any other dialog the site wrote.
//!
+//! Run 1006 added Tarteaucitron on bordeaux-metropole.fr:
+//! `#tarteaucitronAlertBig` (fixed, `role=dialog`, `aria-modal`, `z-index`
+//! 2147483645, a yellow card in the middle of the first screen) inside the
+//! zero-height `#tarteaucitronRoot`.
+//!
//! Run 1004 added Enzuzo on smartbi.ca: `div#ez-cookie-notification`
//! (`enzuzo-cookiebanner-container`, `z-index` 2147483647) over the hero on
//! both widths, its preference modal `div#enzuzo-modal-wrap`, and
@@ -266,6 +280,25 @@ pub const CONSENT_MANAGERS: &[ConsentManager] = &[
body_lock_classes: &["ez-body-lock"],
aria_hidden_marks: &[],
},
+ ConsentManager {
+ name: "Tarteaucitron",
+ // `#tarteaucitronRoot` is a zero-height host; inside it the fixed
+ // banner (`#tarteaucitronAlertBig`, `role=dialog`, `aria-modal`), its
+ // small variant, the 5px progress bar, the preference panel and its
+ // backdrop, and the floating reopen icon.
+ roots: &[
+ "#tarteaucitronRoot",
+ "#tarteaucitronAlertBig",
+ "#tarteaucitronAlertSmall",
+ "#tarteaucitronPercentage",
+ "#tarteaucitron",
+ "#tarteaucitronIcon",
+ ],
+ backdrops: &["#tarteaucitronBack"],
+ html_lock_classes: &[],
+ body_lock_classes: &[],
+ aria_hidden_marks: &[],
+ },
ConsentManager {
name: "Google Funding Choices",
roots: &[".fc-consent-root", ".fc-ccpa-root"],
@@ -539,6 +572,278 @@ pub const OUTSIDE_CONTROLS: &str = "input:not([type='hidden']), select, textarea
pub const OUTSIDE_MEDIA: &str = "img, svg, video, canvas, iframe, object, embed";
pub const OUTSIDE_MEDIA_MIN_AREA: u32 = 10_000;
+/// The name a site's own cookie notice is reported under, in `hidden` and
+/// `consentHidden`, after the listed managers.
+pub const COOKIE_NOTICE: &str = "cookie notice";
+/// The attribute the hide step puts on a site's own cookie notice it hid
+/// (and on the empty full-screen layer beside it), naming the element, so a
+/// later pass reports it again without looking for it twice.
+pub const COOKIE_NOTICE_MARK: &str = "data-impeccable-cookie-notice";
+/// Most visible characters a cookie notice may carry, its preference text
+/// included.
+pub const COOKIE_NOTICE_MAX_TEXT: usize = 1500;
+/// Least visible text the page shows outside a cookie notice for the notice
+/// to be hidden: a page that is little more than its notice is a consent
+/// wall, and is read as before.
+pub const COOKIE_NOTICE_MIN_OUTSIDE_TEXT: usize = 200;
+/// Longest control label read as a consent choice.
+pub const COOKIE_NOTICE_MAX_LABEL: usize = 40;
+/// Largest inline `blur()` radius a cookie lock is taken to have put on the
+/// page (ktk.de: 4px); a larger one is a decoration's.
+pub const COOKIE_NOTICE_MAX_BLUR_PX: f64 = 12.0;
+
+/// Page JS that defines `cookieNotices(out)`: a cookie notice a site wrote
+/// for itself, with none of a listed manager's markup, hidden the way a
+/// manager's banner is. Corpus run 1006: blueeyes.com.tw's `div#cookieBanner`
+/// (fixed, `z-index: 9999`, `rgba(0,0,0,0.8)`, no dialog role) over the first
+/// row of buttons; searchvoro.com's `role=dialog` card (`aria-modal=false`,
+/// `z-index: 95`); ktk.de's `role=dialog` box inside an absolutely positioned
+/// layer the height of the document, beside an empty transparent fixed layer
+/// that takes every hit test, with `filter: blur(4px)` set inline on the page
+/// wrapper. The `z-index` and dialog role a notice carries vary too much to
+/// read; what they share is below.
+///
+/// A notice is found from its choice, inward out:
+/// - a **choice control**: a `button`, `[role=button]`, button input, an `a`
+/// with no `href` or one that only names a fragment or `javascript:`, or an
+/// element with an `onclick` or `cursor: pointer`, whose whole label (at
+/// most 40 characters, case and end punctuation aside) is an accept or
+/// refuse phrase (`Accept`, `Accept all`, `Reject non-essential`, `Allow
+/// all cookies`, `Alle Cookies akzeptieren`, `Tout accepter`, `接受`, ... in
+/// [`cookie_notice_js`]'s list). A softer label (`OK`, `Got it`, `Close`,
+/// `Dismiss`, `Understood`, `Schließen`, `Fermer`, ...) counts only when the
+/// notice's text is a consent sentence: a use verb before `cookie`
+/// ("we use cookies", "verwendet Cookies", "utilise des cookies") or a
+/// policy, settings or preferences word after it. A plain link
+/// (`a[href]`) is never a choice;
+/// - its **box**: the nearest ancestor of the control whose own text
+/// (outside links and controls) names `cookie`, then up through every
+/// ancestor that adds no text, control or media of its own, so a strip
+/// inside a site header, or a bar stacked with a buy bar, is the notice
+/// alone and its container stays;
+/// - that box, an ancestor of it, or a box the widening passed through is
+/// `position: fixed`, or `position: absolute` covering at least 90% of the
+/// viewport (a layer, not the page);
+/// - the control is what the page hit-tests at its centre, and is in the
+/// viewport;
+/// - the box holds no text field, `select`, `textarea`, password or email
+/// input (checkboxes and radios are a preference pane's), no `h1` and no
+/// `main`, so a sign-in or newsletter modal is never one;
+/// - the box carries at most 1,500 visible characters, while the page shows
+/// at least 200 outside it (a page that is only its notice is a wall, and
+/// is read as before).
+///
+/// The box is hidden with an inline `display: none !important` and marked
+/// with [`COOKIE_NOTICE_MARK`]; nothing is clicked. A lock layer beside it is
+/// hidden too: a sibling `div` or `span` with no element children and no
+/// text, `position: fixed`, covering at least 90% of the viewport, with no
+/// background image and a fill under alpha 0.9, a positive `z-index`, and
+/// what the page hit-tests at one of five points while the notice still
+/// shows. When the notice covered at least half the viewport, or a lock
+/// layer went with it, an inline `filter` of one `blur()` of 12px or less on
+/// `html`, `body` or an element up to two levels below `body` outside the
+/// notice, covering at least half the viewport, is removed (`unlocked`:
+/// `filter <name>`), and so is an inline `overflow` / `overflow-y: hidden`
+/// on `html` or `body` when no other dialog is showing.
+fn cookie_notice_js() -> String {
+ format!(
+ r#"const COOKIE_MARK = {mark};
+ const cookieNotices = out => {{
+ const name = {name};
+ const vw = window.innerWidth || 0, vh = window.innerHeight || 0;
+ const body = document.body;
+ if (!body || !vw || !vh) return;
+ const names = [];
+ const report = n => {{ if (!names.includes(n)) names.push(n); }};
+ for (const el of q('[' + COOKIE_MARK + ']')) {{
+ const n = el.getAttribute(COOKIE_MARK);
+ if (n && !n.startsWith('lock ')) report(n);
+ // A late script may rewrite the inline style of a notice or lock this
+ // pass hid; hide it again.
+ try {{
+ if (getComputedStyle(el).display !== 'none') {{ el.style.setProperty('display', 'none', 'important'); out.changed = true; }}
+ }} catch (e) {{}}
+ }}
+ // A whole label that accepts or refuses, in the languages the corpus
+ // reads; and the softer labels that only dismiss.
+ const strict = /^(?:(?:i )?(?:accept|agree|allow|reject|refuse|decline|deny)(?: (?:all|everything))?(?: (?:cookies|all cookies|non-essential|non-essential cookies|optional cookies|necessary|necessary cookies|essential|only necessary|necessary only|essential only|and close|and continue))?|alle(?: cookies)? (?:akzeptieren|ablehnen|zulassen|erlauben)|(?:akzeptieren|ablehnen|zustimmen|zulassen|einverstanden)|(?:tout |tous )?(?:accepter|refuser)(?: tout| et fermer| les cookies| tous les cookies)?|j.accepte|(?:aceptar|rechazar)(?: todo| todas| todas las cookies| cookies)?|(?:aceitar|rejeitar|recusar)(?: todos| tudo| cookies)?|(?:accetta|accetto|rifiuta)(?: tutti| tutto| i cookie)?|(?:alles )?(?:accepteren|weigeren)|接受|全部接受|接受全部|同意|全部同意|拒絕|拒绝|全部拒绝|允許|允许|동의|모두 동의|거부|허용|すべて同意|同意する|拒否|принять|принять все|отклонить|kabul et|tümünü kabul et|reddet)$/;
+ const soft = /^(?:ok|okay|ok,? got it|got it|close|dismiss|understood|i understand|continue|schlie(?:ss|ß)en|verstanden|fermer|compris|d.accord|cerrar|entendido|fechar|entendi|chiudi|ho capito|確定|确定|知道了|닫기|확인|閉じる|закрыть|понятно|tamam|kapat)$/;
+ const consentSentence = t => /\b(?:we|this (?:web)?site|site|our site|uses?|using|used|use of|wir|verwende[nt]?|nutzen|nous|utilise[sz]?|utilisons|usamos|utilizamos|utilizziamo|usiamo|gebruik(?:en|t)?)\b[^.!?]{{0,80}}cookie|cookie[^.!?]{{0,80}}\b(?:polic|setting|preference|richtlinie|einstellung|politique|param|pol[ií]tica|impostazion)|使用[^。]{{0,20}}cookie|cookie[^。]{{0,20}}(?:使用|政策|偏好)|쿠키/i.test(t);
+ const labelOf = c => (c.innerText || c.value || c.getAttribute('aria-label') || '').replace(/\s+/g, ' ').trim().toLowerCase().replace(/[.!…→›»>]+$/u, '').trim();
+ const shownText = el => (el.innerText || '').replace(/\s+/g, ' ').trim();
+ const range = document.createRange();
+ const ownText = root => {{
+ let t = '';
+ const w = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
+ for (let n = w.nextNode(), i = 0; n && i < 4000; n = w.nextNode(), i++) {{
+ const p = n.parentElement;
+ if (!p || p.closest('a, button, [role=button], script, style, noscript, template')) continue;
+ // Rendered text only: a hidden cookie-policy panel inside a welcome
+ // wrapper does not make the wrapper a notice. The text's own boxes
+ // decide, not its parent's: a `display: contents` parent has none.
+ range.selectNodeContents(n);
+ if (!range.getClientRects().length) continue;
+ let vis = 'visible';
+ try {{ vis = getComputedStyle(p).visibility; }} catch (e) {{}}
+ if (vis !== 'visible') continue;
+ t += ' ' + n.data;
+ }}
+ return t;
+ }};
+ const covers = (r, share) => {{
+ const w = Math.max(0, Math.min(r.right, vw) - Math.max(r.left, 0));
+ const h = Math.max(0, Math.min(r.bottom, vh) - Math.max(r.top, 0));
+ return (w * h) / (vw * vh) >= share;
+ }};
+ const meets = r => r.right > 0 && r.bottom > 0 && r.left < vw && r.top < vh;
+ // What a box shows of its own: visible text, controls and media.
+ const content = el => {{
+ let n = 0;
+ for (const c of el.querySelectorAll('a[href], button, [role=button], input:not([type=hidden]), select, textarea, img, svg, video, canvas, iframe')) if (boxShows(c)) n++;
+ return shownText(el).length * 1000 + n;
+ }};
+ const layered = el => {{
+ for (let a = el; a && a !== body && a !== document.documentElement; a = a.parentElement) {{
+ let cs;
+ try {{ cs = getComputedStyle(a); }} catch (e) {{ return false; }}
+ if (cs.position === 'fixed') return true;
+ if (cs.position === 'absolute' && covers(a.getBoundingClientRect(), 0.9)) return true;
+ }}
+ return false;
+ }};
+ const isChoice = c => {{
+ if (c.matches('a[href]')) {{
+ const h = c.getAttribute('href') || '';
+ if (!(h === '' || h.startsWith('#') || /^javascript:/i.test(h))) return false;
+ }}
+ return true;
+ }};
+ const pageChars = shownText(body).length;
+ const found = [];
+ const pick = 'button, [role=button], input[type=button], input[type=submit], a, [onclick], span, div, li';
+ const all = body.querySelectorAll(pick);
+ for (let i = 0; i < all.length && i < 20000; i++) {{
+ const c = all[i];
+ if (found.some(f => f.el.contains(c)) || c.closest('[' + COOKIE_MARK + ']')) continue;
+ // Only an element that acts as a control: a button of some kind, or a
+ // box with a click handler or a pointer cursor whose label is a choice.
+ const kind = c.matches('button, [role=button], input[type=button], input[type=submit], a, [onclick]');
+ let label = '';
+ if (!kind) {{
+ if (c.children.length > 2 || (c.textContent || '').length > 60) continue;
+ label = labelOf(c);
+ if (!label || label.length > {max_label} || !(strict.test(label) || soft.test(label))) continue;
+ try {{ if (getComputedStyle(c).cursor !== 'pointer') continue; }} catch (e) {{ continue; }}
+ if (c.parentElement && c.parentElement.closest('button, [role=button], a, [onclick]')) continue;
+ }} else {{
+ if (!isChoice(c)) continue;
+ label = labelOf(c);
+ }}
+ if (!label || label.length > {max_label}) continue;
+ const isStrict = strict.test(label);
+ if (!isStrict && !soft.test(label)) continue;
+ if (!boxShows(c)) continue;
+ const cr = c.getBoundingClientRect();
+ if (!meets(cr)) continue;
+ // The nearest ancestor whose own text names cookies.
+ let box = c.parentElement;
+ for (let k = 0; box && box !== body && k < 10 && !/cookie/i.test(ownText(box)); k++) box = box.parentElement;
+ if (!box || box === body || box === document.documentElement) continue;
+ if (!/cookie/i.test(ownText(box))) continue;
+ if (!isStrict && !consentSentence(ownText(box))) continue;
+ // Up through every ancestor that adds nothing of its own.
+ const chain = [box];
+ let have = content(box);
+ for (let a = box.parentElement; a && a !== body && a !== document.documentElement; a = a.parentElement) {{
+ const more = content(a);
+ if (more !== have) break;
+ chain.push(a);
+ box = a;
+ }}
+ // On a layer: the box, an ancestor, or a box the widening passed
+ // through (ktk.de's dialog sits in a layer inside a static wrapper).
+ if (!chain.some(layered)) continue;
+ if (!showing(box)) continue;
+ const text = shownText(box);
+ if (!text || text.length > {max_text}) continue;
+ if (box.querySelector('h1, main, textarea, select, input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset])')) continue;
+ if (pageChars - text.length < {min_outside}) continue;
+ const x = Math.min(vw - 1, Math.max(0, cr.left + cr.width / 2)), y = Math.min(vh - 1, Math.max(0, cr.top + cr.height / 2));
+ const hit = document.elementFromPoint(x, y);
+ if (!hit || !box.contains(hit)) continue;
+ const wide = chain.some(el => covers(el.getBoundingClientRect(), 0.5)) || Array.from(box.querySelectorAll('*')).slice(0, 400).some(el => {{
+ try {{ const p = getComputedStyle(el).position; return (p === 'fixed' || p === 'absolute') && covers(el.getBoundingClientRect(), 0.5); }} catch (e) {{ return false; }}
+ }});
+ const cls = Array.from(box.classList || []).find(k => /^[A-Za-z_][\w-]*$/.test(k));
+ const n = box.tagName.toLowerCase() + (box.id ? '#' + box.id : box.getAttribute('role') ? '[role=' + box.getAttribute('role') + ']' : cls ? '.' + cls : '');
+ // A lock layer beside it: empty, see-through or dimming, above the page,
+ // and taking hit tests while the notice shows.
+ const locks = [];
+ const parent = box.parentElement;
+ if (parent && parent !== document.documentElement) {{
+ const points = [[0.5, 0.5], [0.2, 0.2], [0.8, 0.2], [0.2, 0.8], [0.8, 0.8]].map(([px, py]) => [Math.floor(vw * px), Math.floor(vh * py)]);
+ for (const sib of Array.from(parent.children)) {{
+ if (sib === box || !sib.matches('div, span') || sib.children.length || shownText(sib) || sib.hasAttribute(COOKIE_MARK)) continue;
+ let scs;
+ try {{ scs = getComputedStyle(sib); }} catch (e) {{ continue; }}
+ if (scs.position !== 'fixed' || scs.display === 'none' || !covers(sib.getBoundingClientRect(), 0.9)) continue;
+ if (scs.backgroundImage !== 'none') continue;
+ const m = /rgba?\(([^)]*)\)/.exec(scs.backgroundColor || '');
+ const parts = m ? m[1].split(/[\s,/]+/).filter(Boolean) : [];
+ const a = parts.length >= 4 ? parseFloat(parts[3]) : (m ? 1 : 0);
+ if (!(a < 0.9)) continue;
+ if (!(parseInt(scs.zIndex, 10) > 0)) continue;
+ if (!points.some(([px, py]) => document.elementFromPoint(px, py) === sib)) continue;
+ locks.push(sib);
+ }}
+ }}
+ found.push({{ el: box, name: n, wide, locks }});
+ }}
+ let unblur = false;
+ for (const f of found) {{
+ f.el.setAttribute(COOKIE_MARK, f.name);
+ f.el.style.setProperty('display', 'none', 'important');
+ report(f.name);
+ out.changed = true;
+ for (const sib of f.locks) {{
+ sib.setAttribute(COOKIE_MARK, 'lock ' + f.name);
+ sib.style.setProperty('display', 'none', 'important');
+ }}
+ unblur = unblur || f.wide || f.locks.length > 0;
+ }}
+ if (!names.length) return;
+ if (unblur) {{
+ const notice = el => !!el.closest('[' + COOKIE_MARK + ']');
+ const describe = el => el.tagName.toLowerCase() + (el.id ? '#' + el.id : '');
+ const near = [document.documentElement, body];
+ for (const c of Array.from(body.children)) {{ near.push(c); for (const g of Array.from(c.children)) near.push(g); }}
+ for (const el of near) {{
+ // Only a box the size of the page, and only a light blur: a blurred
+ // decoration or a paywalled teaser keeps its own.
+ if (notice(el) || !covers(el.getBoundingClientRect(), 0.5)) continue;
+ const f = el.style.getPropertyValue('filter');
+ const m = /^\s*blur\(\s*([\d.]+)px\s*\)\s*$/.exec(f || '');
+ if (m && parseFloat(m[1]) <= {max_blur}) {{ el.style.removeProperty('filter'); out.unlocked.push('filter ' + describe(el)); out.changed = true; }}
+ }}
+ const otherDialog = q('dialog[open], [aria-modal="true"], [role="dialog"], [role="alertdialog"]').some(el => !notice(el) && showing(el));
+ if (!otherDialog) for (const [el, tag] of [[document.documentElement, 'html'], [body, 'body']]) {{
+ for (const p of ['overflow', 'overflow-y']) {{
+ if (el.style.getPropertyValue(p) === 'hidden') {{ el.style.removeProperty(p); out.unlocked.push(tag + ' style ' + p); out.changed = true; }}
+ }}
+ }}
+ }}
+ if (!out.hidden.includes(name)) out.hidden.push(name);
+ out.matched[name] = (out.matched[name] || []).concat(names.filter(n => !(out.matched[name] || []).includes(n)));
+ }};"#,
+ mark = json!(COOKIE_NOTICE_MARK),
+ name = json!(COOKIE_NOTICE),
+ max_text = COOKIE_NOTICE_MAX_TEXT,
+ min_outside = COOKIE_NOTICE_MIN_OUTSIDE_TEXT,
+ max_label = COOKIE_NOTICE_MAX_LABEL,
+ max_blur = COOKIE_NOTICE_MAX_BLUR_PX,
+ )
+}
+
/// The hide step. Idempotent: run it once before the reveal sweep and again
/// right before the capture, to catch a manager that injects its banner late.
/// Returns `{ hidden: [name], matched: { name: [selector] }, unlocked: [what],
@@ -557,7 +862,8 @@ pub fn hide_js() -> String {
const sels = m.roots.concat(m.backdrops).filter(s => q(s).length > 0);
if (sels.length) present.push({{ m, sels }});
}}
- if (!present.length) return out;
+ {cookie_notices}
+ if (!present.length) {{ cookieNotices(out); return out; }}
let style = document.getElementById(STYLE_ID);
// Measure with the hide rule off, so a banner the rule already hides (one
// injected after the first pass) is still reported. Nothing paints between
@@ -655,6 +961,7 @@ pub fn hide_js() -> String {
}}
}}
if (out.unlocked.length) out.changed = true;
+ cookieNotices(out);
return out;
}})()"#,
managers = managers_json(),
@@ -662,6 +969,7 @@ pub fn hide_js() -> String {
inline_mark = json!(INLINE_HIDE_MARK),
showing = SHOWING_JS,
stamp_is_ours = STAMP_IS_OURS_JS,
+ cookie_notices = cookie_notice_js(),
)
}
@@ -744,7 +1052,7 @@ mod tests {
for name in [
"OneTrust", "Cookiebot", "Usercentrics", "TrustArc", "Didomi", "Quantcast Choice", "Sourcepoint",
"Osano", "CookieYes", "Complianz", "iubenda", "Termly", "Axeptio", "Borlabs Cookie", "Klaro",
- "Cookie Notice", "Shopify", "consentmanager", "Tealium", "Transcend", "Enzuzo",
+ "Cookie Notice", "Shopify", "consentmanager", "Tealium", "Transcend", "Enzuzo", "Tarteaucitron",
] {
assert!(CONSENT_MANAGERS.iter().any(|m| m.name == name), "{name}");
}
diff --git a/crates/browser/src/lib.rs b/crates/browser/src/lib.rs
index 2d99a00e6..d34a37a9f 100644
--- a/crates/browser/src/lib.rs
+++ b/crates/browser/src/lib.rs
@@ -1931,17 +1931,25 @@ fn hide_page_overlays(page: &mut Page<'_>, report: &mut OverlayReport) -> bool {
}
}
-/// Wait up to [`overlays::PRELOADER_WAIT_MS`] for every preloader covering
+/// Wait up to [`overlays::PRELOADER_WAIT_MS`] ([`overlays::INTRO_WAIT_MS`]
+/// while an intro is among them) for every preloader covering
/// the page to go on its own. Returns how long it waited: 0 when none was
/// covering the page, the full budget when one is still there (the hide step
/// then hides it). A failed probe ends the wait.
fn wait_for_preloaders(page: &mut Page<'_>) -> u64 {
let js = overlays::preloader_probe_js();
let started = Instant::now();
- let budget = Duration::from_millis(overlays::PRELOADER_WAIT_MS);
let mut waited = false;
loop {
- let covering = matches!(page.evaluate_value(&js), Ok(Value::Array(a)) if !a.is_empty());
+ let (covering, intro) = match page.evaluate_value(&js) {
+ Ok(Value::Array(a)) => {
+ (!a.is_empty(), a.iter().any(|v| v.as_str().is_some_and(|s| s.starts_with("intro "))))
+ }
+ _ => (false, false),
+ };
+ // An intro gets longer than a preloader: it counts to its end on a
+ // timer of its own, and the page under it may start on that end.
+ let budget = Duration::from_millis(if intro { overlays::INTRO_WAIT_MS } else { overlays::PRELOADER_WAIT_MS });
if !covering || started.elapsed() >= budget {
return if waited { started.elapsed().as_millis() as u64 } else { 0 };
}
diff --git a/crates/browser/src/overlays.rs b/crates/browser/src/overlays.rs
index 227868d93..1e8075b49 100644
--- a/crates/browser/src/overlays.rs
+++ b/crates/browser/src/overlays.rs
@@ -32,6 +32,25 @@
//! `z-index: 9999999`, a spinner and no text) never cleared on its home
//! page, so three of six captures were a white first screen.
//!
+//! - **Intros** as preloaders are, named `intro` or `splash` instead of a
+//! loader word ([`INTRO_WORDS`]), with up to [`INTRO_MAX_TEXT`] characters
+//! and [`INTRO_WAIT_MS`] to go on their own, when they stand in front of a
+//! page: no `h1` of their own, at least [`SPLASH_MIN_OUTSIDE_TEXT`]
+//! characters outside, and something of the page under them at a probe
+//! point (a fixed `section.intro` hero the content scrolls over is the page). A fill counts as opaque when it
+//! is a colour at alpha 0.9 or more or a gradient whose every stop is (for
+//! preloaders too). Corpus run 1006: tirionai.com's `div.cine-intro`.
+//! - **Splash gates** by structure (`splashes()` in [`preloader_js`]): a
+//! fixed layer covering the first screen and on top of it, with an opaque
+//! fill, at most 60 characters of text that ask the visitor to enter
+//! ([`ENTER_WORDS`]), no age, cookie, accept or agree words, no field,
+//! frame or dialog, at most one link or button, and a way through (the
+//! layer is `cursor: pointer` or has an `onclick`, or its one control says
+//! enter), standing in front of a page as an intro must. Hidden at once,
+//! never clicked. Corpus run 1006: noteforge.co's
+//! "Enter NoteForge" layer, which stays until clicked, covered all six
+//! captures.
+//!
//! - **Builder badges** by the builder's own markup ([`BUILDER_BADGES`]): the
//! "Edit with" badge a site builder pins over pages it hosts. Corpus run 42:
//! Lovable's `aside#lovable-badge` (`aria-label="Edit with Lovable"`, a
@@ -40,7 +59,8 @@
//! The badge is the builder's, not the site's design.
//!
//! Left alone on purpose: a gate the visitor has to answer (a state or
-//! region picker, an age gate, a sign-in wall) and a site's own interstitial
+//! region picker, an age gate, a sign-in wall; a splash whose one answer is
+//! to enter is not one) and a site's own interstitial
//! (a welcome dialog, a newsletter modal) carry text and controls, so no
//! structural test here matches them, and the Pristine rule that reports an
//! interstitial at load still sees them.
@@ -92,6 +112,9 @@ pub const HIDE_STYLE_ID: &str = "impeccable-overlay-hide";
/// The attribute the preloader hide step puts on a layer it hid, naming it,
/// so a later pass reports it again without hiding twice.
pub const PRELOADER_MARK: &str = "data-impeccable-hidden";
+/// Beside [`PRELOADER_MARK`], the kind of a layer that is not a preloader
+/// (`intro`, `splash`).
+pub const KIND_MARK: &str = "data-impeccable-hidden-kind";
/// How long the engine waits for a preloader to go on its own before hiding
/// it, and how often it looks.
@@ -112,6 +135,39 @@ pub const WRAPPER_WORDS: &[&str] = &[
/// Most visible characters a preloader may carry ("Loading...", "75%", a
/// brand word).
pub const PRELOADER_MAX_TEXT: usize = 60;
+
+/// Id and class words that name an intro: a layer named this way passes the
+/// preloader tests with up to [`INTRO_MAX_TEXT`] characters (a brand line
+/// beside a progress count) and gets [`INTRO_WAIT_MS`] to go on its own.
+/// Corpus run 1006: tirionai.com's `div.cine-intro` (fixed, `z-index: 300`,
+/// a radial-gradient fill, "TIRIONAI For the places you can't always watch.
+/// RENDERING 47%", 61 characters) counted to 100% for 6 to 17 seconds after
+/// load, and covered the mobile capture.
+pub const INTRO_WORDS: &[&str] = &["intro", "splash", "splashscreen"];
+pub const INTRO_MAX_TEXT: usize = 120;
+/// How long the engine waits for an intro to go on its own.
+pub const INTRO_WAIT_MS: u64 = 12000;
+
+/// Words a splash gate's text uses to let the visitor in. A splash is
+/// hidden, not clicked: a full-screen layer whose one action is to go away
+/// paints the page beneath once it has.
+pub const ENTER_WORDS: &[&str] = &[
+ "enter",
+ "entrer",
+ "entrez",
+ "entrar",
+ "entra",
+ "eintreten",
+ "betreten",
+ "进入",
+ "進入",
+ "입장",
+];
+/// Most visible characters a splash gate may carry ("Enter NoteForge →").
+pub const SPLASH_MAX_TEXT: usize = 60;
+/// Least visible text the page shows outside a splash or an intro for it to
+/// be hidden: under that, the layer is the page.
+pub const SPLASH_MIN_OUTSIDE_TEXT: usize = 200;
/// Least share of the first screen a preloader covers.
pub const PRELOADER_MIN_COVER: f64 = 0.9;
@@ -120,21 +176,68 @@ pub const PRELOADER_MIN_COVER: f64 = 0.9;
pub fn preloader_js() -> String {
format!(
r#"const loaderWords = {words};
+ const introWords = {intro_words};
+ const enterWords = {enter_words};
const wrapperWords = {wrappers};
// A token names a loader when, after any trailing wrapper words
// (`-wrapper`, `_bg`), its last word is a loader word: `preloader`,
// `pre-loader`, `page_loader_bg`, `loader-wrapper`, `is-loading`.
- const namesLoader = token => {{
+ const namesIn = words => token => {{
const parts = String(token).toLowerCase().split(/[-_]+/).filter(Boolean);
while (parts.length > 1 && wrapperWords.includes(parts[parts.length - 1])) parts.pop();
- return parts.length > 0 && loaderWords.includes(parts[parts.length - 1]);
+ return parts.length > 0 && words.includes(parts[parts.length - 1]);
}};
+ const namesLoader = namesIn(loaderWords);
+ const namesIntro = namesIn(introWords);
const alpha = c => {{
const m = /rgba?\(([^)]*)\)/.exec(c || '');
if (!m) return 0;
const p = m[1].split(/[\s,/]+/).filter(Boolean);
return p.length >= 4 ? parseFloat(p[3]) : 1;
}};
+ // A fill that hides what is under it: an opaque colour, or a gradient
+ // whose every stop is opaque.
+ const opaqueFill = cs => {{
+ if (alpha(cs.backgroundColor) >= 0.9) return true;
+ const img = cs.backgroundImage || '';
+ if (!/gradient\(/.test(img) || /url\(/.test(img)) return false;
+ const stops = img.match(/rgba?\([^)]*\)/g) || [];
+ return stops.length > 0 && stops.every(c => alpha(c) >= 0.9);
+ }};
+ // Whether a full-screen layer stands in front of a page rather than being
+ // it: no h1 of its own, at least {min_outside} characters of text outside
+ // it, and, with the layer out of the hit test, something of the page
+ // under it at one of the probe points (text of its own, a replaced
+ // element, or a box smaller than the screen). A hero the content scrolls
+ // over from 100vh, or a one-screen site, has nothing under it.
+ const frontsPage = (el, points) => {{
+ const vw = window.innerWidth || 0, vh = window.innerHeight || 0;
+ if (el.querySelector('h1')) return false;
+ const chars = n => (n.innerText || '').replace(/\s+/g, ' ').trim().length;
+ if (!document.body || chars(document.body) - chars(el) < {min_outside}) return false;
+ const big = r => {{
+ const w = Math.max(0, Math.min(r.right, vw) - Math.max(r.left, 0));
+ const h = Math.max(0, Math.min(r.bottom, vh) - Math.max(r.top, 0));
+ return (w * h) / (vw * vh) >= 0.9;
+ }};
+ const prev = [el.style.getPropertyValue('visibility'), el.style.getPropertyPriority('visibility')];
+ el.style.setProperty('visibility', 'hidden', 'important');
+ try {{
+ return points.some(([x, y]) => {{
+ const hit = document.elementFromPoint(x, y);
+ if (!hit || hit === document.body || hit === document.documentElement || el.contains(hit)) return false;
+ const own = Array.from(hit.childNodes).some(n => n.nodeType === 3 && n.data.trim());
+ return own || hit.matches('img, svg, video, canvas, picture, input, button, textarea, select') || !big(hit.getBoundingClientRect());
+ }});
+ }} finally {{
+ if (prev[0]) el.style.setProperty('visibility', prev[0], prev[1]);
+ else el.style.removeProperty('visibility');
+ }}
+ }};
+ const enterText = t => {{
+ const words = t.toLowerCase().split(/[^\p{{L}}\p{{N}}]+/u).filter(Boolean);
+ return words.some(w => enterWords.includes(w)) || enterWords.some(w => /[^\x00-\x7f]/.test(w) && t.includes(w));
+ }};
const preloaders = () => {{
const vw = window.innerWidth || 0, vh = window.innerHeight || 0;
if (!vw || !vh) return [];
@@ -149,18 +252,19 @@ pub fn preloader_js() -> String {
for (let i = 0; i < all.length && i < 20000; i++) {{
const el = all[i];
const tokens = [el.id].concat(Array.from(el.classList || [])).filter(Boolean);
- if (!tokens.some(namesLoader)) continue;
+ const loader = tokens.some(namesLoader);
+ if (!loader && !tokens.some(namesIntro)) continue;
let cs;
try {{ cs = getComputedStyle(el); }} catch (e) {{ continue; }}
if (cs.position !== 'fixed' || cs.display === 'none' || cs.visibility !== 'visible' || parseFloat(cs.opacity) <= 0.05) continue;
try {{ if (el.checkVisibility && !el.checkVisibility({{ opacityProperty: true, visibilityProperty: true }})) continue; }} catch (e) {{}}
if (!covers(el.getBoundingClientRect())) continue;
// Opaque on itself, or on a descendant that covers the screen too.
- let opaque = alpha(cs.backgroundColor) >= 0.9;
+ let opaque = opaqueFill(cs);
if (!opaque) {{
const kids = el.querySelectorAll('*');
for (let k = 0; k < kids.length && k < 200 && !opaque; k++) {{
- try {{ opaque = alpha(getComputedStyle(kids[k]).backgroundColor) >= 0.9 && covers(kids[k].getBoundingClientRect()); }} catch (e) {{}}
+ try {{ opaque = opaqueFill(getComputedStyle(kids[k])) && covers(kids[k].getBoundingClientRect()); }} catch (e) {{}}
}}
}}
if (!opaque) continue;
@@ -184,25 +288,101 @@ pub fn preloader_js() -> String {
// Not a gate or a dialog: no control, link, frame or dialog inside.
if (el.matches('[role=dialog], [role=alertdialog], [aria-modal=true], dialog')) continue;
if (el.querySelector('a[href], button, input:not([type=hidden]), select, textarea, iframe, [role=button], [role=dialog], [role=alertdialog], [aria-modal=true], dialog, [contenteditable=""], [contenteditable=true]')) continue;
- if ((el.innerText || '').replace(/\s+/g, ' ').trim().length > {max_text}) continue;
+ const shown = (el.innerText || '').replace(/\s+/g, ' ').trim();
+ if (shown.length > (loader ? {max_text} : {intro_max_text})) continue;
+ // A layer that asks to be entered and has a way through is a splash
+ // gate: it never goes on its own, so it is not waited for
+ // (`splashes`). A loader that only mentions entering ("Preparing to
+ // enter the site") has none and is still a loader.
+ if (enterText(shown) && shown.length <= {splash_max_text} && (cs.cursor === 'pointer' || el.hasAttribute('onclick'))) continue;
+ // A long enter-worded layer is still an intro, unless it is an answer
+ // (an age gate or a consent choice), which stays.
+ if (!loader && enterText(shown) && /\b(18|21)\b|\+18|\bage\b|\bâge\b|\balter\b|\bedad\b|\bidade\b|cookie|accept|agree/i.test(shown)) continue;
+ // An intro fronts a page that is already there; a fixed hero is the page.
+ if (!loader && !frontsPage(el, points)) continue;
// The outermost match stands for the ones inside it.
if (found.some(f => f.el.contains(el))) continue;
- const cls = Array.from(el.classList || []).find(namesLoader);
- const name = el.tagName.toLowerCase() + (el.id && namesLoader(el.id) ? '#' + el.id : cls ? '.' + cls : el.id ? '#' + el.id : '');
- found.push({{ el, name }});
+ const names = loader ? namesLoader : namesIntro;
+ const cls = Array.from(el.classList || []).find(names);
+ const name = el.tagName.toLowerCase() + (el.id && names(el.id) ? '#' + el.id : cls ? '.' + cls : el.id ? '#' + el.id : '');
+ found.push({{ el, name, kind: loader ? 'preloader' : 'intro' }});
+ }}
+ return found;
+ }};
+ // Splash gates: a fixed layer over the whole first screen whose short
+ // text lets the visitor in ("Enter NoteForge"), with one way through (the
+ // layer itself, or its one link or button) and nothing else to answer.
+ const splashes = () => {{
+ const vw = window.innerWidth || 0, vh = window.innerHeight || 0;
+ if (!vw || !vh) return [];
+ const covers = r => {{
+ const w = Math.max(0, Math.min(r.right, vw) - Math.max(r.left, 0));
+ const h = Math.max(0, Math.min(r.bottom, vh) - Math.max(r.top, 0));
+ return (w * h) / (vw * vh) >= {cover};
+ }};
+ const points = [[0.5, 0.5], [0.2, 0.2], [0.8, 0.2], [0.2, 0.8], [0.8, 0.8]].map(([x, y]) => [Math.floor(vw * x), Math.floor(vh * y)]);
+ const found = [];
+ const all = document.body ? document.body.querySelectorAll('*') : [];
+ for (let i = 0; i < all.length && i < 20000; i++) {{
+ const el = all[i];
+ if (found.some(f => f.el.contains(el))) continue;
+ let cs;
+ try {{ cs = getComputedStyle(el); }} catch (e) {{ continue; }}
+ if (cs.position !== 'fixed' || cs.display === 'none' || cs.visibility !== 'visible' || parseFloat(cs.opacity) <= 0.05) continue;
+ if (!covers(el.getBoundingClientRect())) continue;
+ const text = (el.innerText || '').replace(/\s+/g, ' ').trim();
+ if (!text || text.length > {splash_max_text} || !enterText(text)) continue;
+ // Not an age gate or a consent choice: those are answers, not a door.
+ if (/\b(18|21)\b|\+18|\bage\b|\bâge\b|\balter\b|\bedad\b|\bidade\b|cookie|accept|agree/i.test(text)) continue;
+ if (el.matches('[role=dialog], [role=alertdialog], [aria-modal=true], dialog')) continue;
+ if (el.querySelector('input:not([type=hidden]), select, textarea, iframe, form, [role=dialog], [role=alertdialog], [aria-modal=true], dialog, [contenteditable=""], [contenteditable=true]')) continue;
+ const controls = el.querySelectorAll('a[href], button, [role=button]');
+ if (controls.length > 1) continue;
+ if (!(cs.cursor === 'pointer' || el.hasAttribute('onclick') || (controls.length === 1 && enterText((controls[0].innerText || controls[0].getAttribute('aria-label') || '').trim())))) continue;
+ let opaque = opaqueFill(cs);
+ if (!opaque) {{
+ const kids = el.querySelectorAll('*');
+ for (let k = 0; k < kids.length && k < 200 && !opaque; k++) {{
+ try {{ opaque = opaqueFill(getComputedStyle(kids[k])) && covers(kids[k].getBoundingClientRect()); }} catch (e) {{}}
+ }}
+ }}
+ if (!opaque) continue;
+ const passThrough = cs.pointerEvents === 'none';
+ const pe = [el.style.getPropertyValue('pointer-events'), el.style.getPropertyPriority('pointer-events')];
+ if (passThrough) el.style.setProperty('pointer-events', 'auto', 'important');
+ let onTop;
+ try {{
+ onTop = points.every(([x, y]) => {{ const hit = document.elementFromPoint(x, y); return !!hit && (hit === el || el.contains(hit)); }});
+ }} finally {{
+ if (passThrough) {{
+ if (pe[0]) el.style.setProperty('pointer-events', pe[0], pe[1]);
+ else el.style.removeProperty('pointer-events');
+ }}
+ }}
+ if (!onTop) continue;
+ if (!frontsPage(el, points)) continue;
+ const cls = Array.from(el.classList || []).find(c => /^[A-Za-z_][\w-]*$/.test(c));
+ const name = el.tagName.toLowerCase() + (el.id ? '#' + el.id : cls ? '.' + cls : '') + ' ("' + text.slice(0, 40).replace(/"/g, "'") + '")';
+ found.push({{ el, name, kind: 'splash' }});
}}
return found;
}};"#,
words = json!(LOADER_WORDS),
+ intro_words = json!(INTRO_WORDS),
+ enter_words = json!(ENTER_WORDS),
wrappers = json!(WRAPPER_WORDS),
cover = PRELOADER_MIN_COVER,
max_text = PRELOADER_MAX_TEXT,
+ intro_max_text = INTRO_MAX_TEXT,
+ splash_max_text = SPLASH_MAX_TEXT,
+ min_outside = SPLASH_MIN_OUTSIDE_TEXT,
)
}
-/// The wait probe: the names of the preloaders covering the page now.
+/// The wait probe: the preloaders and intros covering the page now, each as
+/// `<kind> <name>` (`preloader div#preloader`, `intro div.cine-intro`).
pub fn preloader_probe_js() -> String {
- format!("(() => {{\n {}\n return preloaders().map(p => p.name);\n}})()", preloader_js())
+ format!("(() => {{\n {}\n return preloaders().map(p => p.kind + ' ' + p.name);\n}})()", preloader_js())
}
fn tours_json() -> Value {
@@ -246,6 +426,7 @@ pub fn hide_js() -> String {
const tours = {tours};
const STYLE_ID = {style_id};
const MARK = {mark};
+ const KIND_MARK = {kind_mark};
const q = s => {{ try {{ return Array.from(document.querySelectorAll(s)); }} catch (e) {{ return []; }} }};
const boxShows = el => {{
try {{
@@ -295,15 +476,17 @@ pub fn hide_js() -> String {
// Preloaders: hidden ones (marked) are reported again; new ones hidden.
for (const el of q('[' + MARK + ']')) {{
const name = el.getAttribute(MARK);
- if (name && !out.hidden.some(h => h.kind === 'preloader' && h.name === name)) out.hidden.push({{ kind: 'preloader', name }});
+ const kind = el.getAttribute(KIND_MARK) || 'preloader';
+ if (name && !out.hidden.some(h => h.kind === kind && h.name === name)) out.hidden.push({{ kind, name }});
}}
let hidLoader = false;
- for (const {{ el, name }} of preloaders()) {{
+ for (const {{ el, name, kind }} of preloaders().concat(splashes())) {{
el.setAttribute(MARK, name);
+ if (kind !== 'preloader') el.setAttribute(KIND_MARK, kind);
el.style.setProperty('display', 'none', 'important');
out.changed = true;
hidLoader = true;
- if (!out.hidden.some(h => h.kind === 'preloader' && h.name === name)) out.hidden.push({{ kind: 'preloader', name }});
+ if (!out.hidden.some(h => h.kind === kind && h.name === name)) out.hidden.push({{ kind, name }});
}}
// The page's own script would clear the loader and the scroll lock it
// keeps with it; hiding the loader does not run that script. Undo the
@@ -345,6 +528,7 @@ pub fn hide_js() -> String {
tours = tours_json(),
style_id = json!(HIDE_STYLE_ID),
mark = json!(PRELOADER_MARK),
+ kind_mark = json!(KIND_MARK),
preloader = preloader_js(),
)
}
@@ -399,7 +583,7 @@ impl OverlayReport {
if !self.hidden.contains(&item) {
self.hidden.push(item);
}
- if kind != "preloader" {
+ if kind == "tour" || kind == "badge" {
let sels = strs(v.get("matched").and_then(|m| m.get(name)));
match self.matched.iter_mut().find(|(n, _)| n == name) {
Some((_, have)) => {
diff --git a/crates/browser/tests/consent_hiding.rs b/crates/browser/tests/consent_hiding.rs
index abd794124..4c25b6b74 100644
--- a/crates/browser/tests/consent_hiding.rs
+++ b/crates/browser/tests/consent_hiding.rs
@@ -9,7 +9,11 @@
//! - A Cookiebot-shaped modal injected late, on the first scroll, with an
//! underlay and an inline scroll lock on `<body>`: caught by the hide pass
//! after the reveal sweep, recorded in the evidence, and the lock undone.
-//! - A notice the site wrote itself (generic names, no vendor) stays.
+//! - A cookie notice the site wrote itself (no vendor markup) is hidden, and
+//! so are a ktk.de-shaped lock's empty layer and the blur it put on the
+//! page; a newsletter or sign-in modal, a bar that only links a cookie
+//! policy, and a notice over a page too short to be more than it stay.
+//! - Tarteaucitron's banner is hidden.
//! - A page that is only a consent wall is refused as one; with the banners
//! kept it is scanned, since the banner is what that scan asked for.
//! - A short page under an ordinary banner (a sign-in form) is not a wall.
@@ -188,17 +192,100 @@ fn a_late_cookiebot_modal_is_caught_and_its_scroll_lock_undone() {
}
#[test]
-fn a_notice_the_site_wrote_itself_stays() {
+fn a_cookie_notice_the_site_wrote_itself_is_hidden() {
let Some(engine) = engine() else { return };
let port = serve();
let url = format!("http://127.0.0.1:{port}/site-notice.html");
let scan = engine.detect_url_scan(&url, &ScanOptions::default()).expect("scan");
let shown = flagged(&scan.findings);
- assert!(!has(&shown, "low-contrast", "#covered-copy"), "{shown:#?}");
- assert!(!has(&shown, "low-contrast", "#covered-cta"), "{shown:#?}");
- assert!(has(&shown, "low-contrast", "#notice-text"), "{shown:#?}");
- assert!(scan.findings.iter().all(|f| f.extras.get("consentHidden").is_none()));
- assert!(scan.notes.is_empty());
+ assert!(has(&shown, "low-contrast", "#covered-copy"), "{shown:#?}");
+ assert!(!has(&shown, "low-contrast", "#notice-text"), "{shown:#?}");
+ for f in &scan.findings {
+ assert_eq!(f.extras.get("consentHidden"), Some(&serde_json::json!(["cookie notice"])), "{f:?}");
+ }
+ let mut browser = engine.launch().expect("launch");
+ let (_, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ let (kept, _) = detect_url_evidence(&mut browser, &url, &KEEP, "load", 100, &EvidenceRequest::default()).expect("scan");
+ browser.close();
+ let consent = evidence.consent.as_ref().expect("consent report");
+ assert_eq!(consent.hidden, vec!["cookie notice"]);
+ assert_eq!(consent.matched, vec![("cookie notice".to_string(), vec!["div#cookieBanner".to_string()])]);
+ // Kept (--no-consent-hiding), the bar stays and its own text is scored.
+ assert!(has(&flagged(&kept), "low-contrast", "#notice-text"), "{kept:#?}");
+}
+
+/// The same notice with its sentence in a `display: contents` span, which
+/// has no box of its own: the text still renders, so it is still a notice.
+#[test]
+fn a_site_notice_whose_text_has_no_box_of_its_own_is_hidden() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/site-notice-contents.html");
+ let mut browser = engine.launch().expect("launch");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ browser.close();
+ assert!(has(&flagged(&findings), "low-contrast", "#covered-copy"), "{findings:#?}");
+ let consent = evidence.consent.as_ref().expect("consent report");
+ assert_eq!(consent.hidden, vec!["cookie notice"]);
+}
+
+/// The site's own notices that are not cookie notices, and one over a page
+/// too short to be more than its notice, stay on the page.
+#[test]
+fn dialogs_that_are_not_cookie_notices_stay() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ for (page, own) in [
+ ("site-notice-short.html", "#notice-text"),
+ ("site-newsletter.html", "#modal-text"),
+ ("site-login.html", "#modal-text"),
+ ("site-policy-link.html", "#modal-text"),
+ ] {
+ let url = format!("http://127.0.0.1:{port}/{page}");
+ let scan = engine.detect_url_scan(&url, &ScanOptions::default()).expect("scan");
+ let shown = flagged(&scan.findings);
+ assert!(has(&shown, "low-contrast", own), "{page}: {shown:#?}");
+ assert!(scan.findings.iter().all(|f| f.extras.get("consentHidden").is_none()), "{page}");
+ assert!(scan.notes.is_empty(), "{page}: {:?}", scan.notes);
+ }
+}
+
+#[test]
+fn a_cookie_lock_its_empty_layer_and_the_blur_go() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/site-lock-blur.html");
+ let mut browser = engine.launch().expect("launch");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ browser.close();
+ let shown = flagged(&findings);
+ assert!(has(&shown, "low-contrast", "#covered-copy"), "{shown:#?}");
+ assert!(!has(&shown, "low-contrast", "#notice-text"), "{shown:#?}");
+ let consent = evidence.consent.as_ref().expect("consent report");
+ assert_eq!(consent.matched, vec![("cookie notice".to_string(), vec!["div#block".to_string()])]);
+ assert_eq!(consent.unlocked, vec!["filter div#page"]);
+ let snap = evidence.scan_snapshot.as_deref().unwrap();
+ assert!(snap.contains("lock div#block"), "the empty lock layer is marked hidden");
+}
+
+#[test]
+fn a_tarteaucitron_banner_is_hidden() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/tarteaucitron.html");
+ let scan = engine.detect_url_scan(&url, &ScanOptions::default()).expect("scan");
+ let shown = flagged(&scan.findings);
+ assert!(has(&shown, "low-contrast", "#covered-copy"), "{shown:#?}");
+ assert!(!has(&shown, "low-contrast", "#tarteaucitronDisclaimerAlert"), "{shown:#?}");
+ for f in &scan.findings {
+ assert_eq!(f.extras.get("consentHidden"), Some(&serde_json::json!(["Tarteaucitron"])), "{f:?}");
+ }
}
#[test]
@@ -549,3 +636,64 @@ fn tealium_and_transcend_banners_are_hidden() {
}
}
}
+
+/// The review's probes (work/round12/harness-review.md): page parts that
+/// mention cookies, or sit beside a real cookie bar, stay as they are.
+#[test]
+fn page_parts_that_look_like_a_notice_stay() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ for page in ["stay-announce.html", "stay-header.html", "stay-cart.html", "stay-gdpr-modal.html", "stay-hidden-policy.html"] {
+ let url = format!("http://127.0.0.1:{port}/{page}");
+ let scan = engine.detect_url_scan(&url, &ScanOptions::default()).expect("scan");
+ assert!(has(&flagged(&scan.findings), "low-contrast", "#own"), "{page}: {:#?}", flagged(&scan.findings));
+ assert!(scan.findings.iter().all(|f| f.extras.get("consentHidden").is_none()), "{page}");
+ }
+}
+
+#[test]
+fn a_notice_inside_a_header_or_a_stack_goes_alone() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let mut browser = engine.launch().expect("launch");
+ for (page, notice) in [("header-strip.html", "div.cookie-strip"), ("bottom-stack.html", "div.cookies")] {
+ let url = format!("http://127.0.0.1:{port}/{page}");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ assert!(has(&flagged(&findings), "low-contrast", "#own"), "{page}: {:#?}", flagged(&findings));
+ let consent = evidence.consent.as_ref().expect("consent report");
+ assert_eq!(consent.matched, vec![("cookie notice".to_string(), vec![notice.to_string()])], "{page}");
+ }
+ browser.close();
+}
+
+#[test]
+fn backgrounds_and_blurs_beside_a_cookie_bar_stay() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let mut browser = engine.launch().expect("launch");
+ for page in [
+ "stay-bg-layer.html",
+ "stay-bg-image.html",
+ "stay-bg-canvas.html",
+ "stay-blur-deco.html",
+ "stay-blur-deco-absolute.html",
+ "stay-blur-paywall.html",
+ ] {
+ let url = format!("http://127.0.0.1:{port}/{page}");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ let consent = evidence.consent.as_ref().expect("consent report");
+ assert_eq!(consent.matched, vec![("cookie notice".to_string(), vec!["div.cookie-bar".to_string()])], "{page}");
+ assert!(consent.unlocked.is_empty(), "{page}: {:?}", consent.unlocked);
+ assert!(!evidence.scan_snapshot.as_deref().unwrap().contains("lock div.cookie-bar"), "{page}");
+ // The light title on the dark image is not read against white (the
+ // review's probe: hiding the background made it 1.1:1).
+ if page == "stay-bg-image.html" {
+ assert!(!has(&flagged(&findings), "low-contrast", "#night-title"), "{page}: {:#?}", flagged(&findings));
+ }
+ }
+ browser.close();
+}
diff --git a/crates/browser/tests/overlay_hiding.rs b/crates/browser/tests/overlay_hiding.rs
index bc7f06606..d0f818f56 100644
--- a/crates/browser/tests/overlay_hiding.rs
+++ b/crates/browser/tests/overlay_hiding.rs
@@ -13,6 +13,10 @@
//! - A preloader that clears on its own is waited for and nothing is hidden.
//! - A routing gate on a full-screen opaque layer named like a loader stays:
//! it holds controls, so it is not a preloader.
+//! - A click-to-enter splash is hidden (not clicked); an age gate on the
+//! same kind of layer stays.
+//! - An intro named as one, with a gradient fill and a progress line, is
+//! waited for, and hidden once its budget runs out.
use std::collections::HashMap;
use std::io::{Read, Write};
@@ -185,6 +189,23 @@ fn a_stuck_preloader_is_waited_for_then_hidden() {
assert!(!has(&flagged(&kept), "low-contrast", "#covered-copy"), "{kept:#?}");
}
+/// A loader whose short message mentions entering but offers no way
+/// through is still a loader: waited for, then hidden (review on #1106).
+#[test]
+fn a_stuck_preloader_that_mentions_entering_is_hidden() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/preloader-enter-text.html");
+ let mut browser = engine.launch().expect("launch");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ browser.close();
+ assert!(has(&flagged(&findings), "low-contrast", "#covered-copy"), "{findings:#?}");
+ let report = evidence.overlays.as_ref().expect("overlay report");
+ assert_eq!(report.hidden, vec![hidden("preloader", "div#preloader")]);
+}
+
#[test]
fn a_stuck_preloader_clicks_pass_through_is_hidden_too() {
let Some(engine) = engine() else { return };
@@ -292,3 +313,118 @@ fn a_lovable_badge_is_hidden_and_the_copy_under_it_scored() {
let shown = flagged(&kept);
assert!(shown.iter().any(|(_, s)| s.contains("lovable-badge")), "{shown:#?}");
}
+
+#[test]
+fn a_click_to_enter_splash_is_hidden() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/splash.html");
+ let mut browser = engine.launch().expect("launch");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ let (kept, _) = detect_url_evidence(&mut browser, &url, &KEEP, "load", 100, &EvidenceRequest::default()).expect("scan");
+ browser.close();
+ assert!(has(&flagged(&findings), "low-contrast", "#covered-copy"), "{findings:#?}");
+ let report = evidence.overlays.as_ref().expect("overlay report");
+ assert_eq!(report.hidden, vec![hidden("splash", "div.splash (\"Enter NoteForge \u{2192}\")")]);
+ // Hidden at once: a splash is never waited for.
+ assert_eq!(report.waited_ms, 0);
+ assert!(!has(&flagged(&kept), "low-contrast", "#covered-copy"), "{kept:#?}");
+}
+
+#[test]
+fn an_age_gate_stays() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/age-gate.html");
+ let scan = engine.detect_url_scan(&url, &ScanOptions::default()).expect("scan");
+ assert!(!has(&flagged(&scan.findings), "low-contrast", "#covered-copy"), "{:#?}", scan.findings);
+ assert!(scan.findings.iter().all(|f| f.extras.get("overlaysHidden").is_none()));
+}
+
+#[test]
+fn an_intro_that_ends_is_waited_for_and_nothing_hidden() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/intro-clears.html");
+ let mut browser = engine.launch().expect("launch");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ browser.close();
+ assert!(has(&flagged(&findings), "low-contrast", "#covered-copy"), "{findings:#?}");
+ let report = evidence.overlays.as_ref().expect("overlay report");
+ assert!(report.hidden.is_empty(), "{report:?}");
+ assert!(report.waited_ms > 0 && report.waited_ms < impeccable_browser::overlays::PRELOADER_WAIT_MS, "{}", report.waited_ms);
+}
+
+#[test]
+fn an_intro_that_never_ends_is_hidden_after_its_budget() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/intro-stuck.html");
+ let mut browser = engine.launch().expect("launch");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ browser.close();
+ assert!(has(&flagged(&findings), "low-contrast", "#covered-copy"), "{findings:#?}");
+ let report = evidence.overlays.as_ref().expect("overlay report");
+ assert_eq!(report.hidden, vec![hidden("intro", "div.cine-intro")]);
+ assert!(report.waited_ms >= impeccable_browser::overlays::INTRO_WAIT_MS, "{}", report.waited_ms);
+}
+
+/// A named intro whose text is longer than a splash allows and mentions
+/// entering is still an intro: waited for, then hidden.
+#[test]
+fn a_long_named_intro_that_says_enter_is_still_hidden() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/intro-enter-text.html");
+ let mut browser = engine.launch().expect("launch");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ browser.close();
+ assert!(has(&flagged(&findings), "low-contrast", "#covered-copy"), "{findings:#?}");
+ let report = evidence.overlays.as_ref().expect("overlay report");
+ assert_eq!(report.hidden, vec![hidden("intro", "div.cine-intro")]);
+}
+
+/// A long named layer that says enter and states an age is an age gate:
+/// it stays.
+#[test]
+fn a_long_named_age_gate_stays() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let url = format!("http://127.0.0.1:{port}/intro-age-gate.html");
+ let mut browser = engine.launch().expect("launch");
+ let (_, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ browser.close();
+ let report = evidence.overlays.as_ref().expect("overlay report");
+ assert!(report.hidden.is_empty(), "{report:?}");
+}
+
+/// The review's probes: a one-screen site, a curtain hero with an Enter
+/// link, and a fixed hero named intro are the page, not a layer in front of
+/// it. Nothing is hidden and nothing is waited for.
+#[test]
+fn heroes_that_are_the_page_stay() {
+ let Some(engine) = engine() else { return };
+ let port = serve();
+ let mut browser = engine.launch().expect("launch");
+ for page in ["stay-landing.html", "stay-curtain.html", "stay-intro-hero.html"] {
+ let url = format!("http://127.0.0.1:{port}/{page}");
+ let (findings, evidence) =
+ detect_url_evidence(&mut browser, &url, &ScanOptions::default(), "load", 100, &EvidenceRequest::default())
+ .expect("scan");
+ assert!(has(&flagged(&findings), "low-contrast", "#own"), "{page}: {:#?}", flagged(&findings));
+ let report = evidence.overlays.as_ref().expect("overlay report");
+ assert!(report.hidden.is_empty(), "{page}: {report:?}");
+ assert_eq!(report.waited_ms, 0, "{page}");
+ }
+ browser.close();
+}
diff --git a/docs/CLI-CONTRACT.md b/docs/CLI-CONTRACT.md
index dcaa6c3ba..0faa3d6ba 100644
--- a/docs/CLI-CONTRACT.md
+++ b/docs/CLI-CONTRACT.md
@@ -99,7 +99,7 @@ Notation: `stdout>` / `stderr>` are literal writes; `exit N`; template strings u
| `--list-rules` | print every registered rule (`all_antipatterns()`: the built-ins plus any installed rule pack) and **exit 0** without scanning. Catalog goes to **stdout**. `--json` pretty-prints an array of `{id,name,category,severity,scopes,description}` (plus `advisory: true` on advisory rules). `--quiet` prints one rule id per line. `--scope` and `--no-advisory` filter the catalog the same way they filter a scan; config ignores (`ignoreRules`) are not applied, so the catalog lists rules a project has switched off. `--github` with it is rejected (see `--github`). A positional target or `--cdp` with it → `stderr> Error: --list-rules prints the rule catalog and takes no file, URL, or --cdp scan\n`, `exit 1`. Evaluated after `--help` (so `--list-rules --help` prints usage) |
| `--help` | print usage (stdout) and `exit 0` — evaluated *after* scope/viewport parsing (so a bad `--scope` still errors first) |
| `--no-advisory` | drop findings with `advisory === true` before output/exit-code |
-| `--no-consent-hiding` | URL scans only (Rust engine): leave known consent managers' banners on the page instead of hiding them before the scan (see **Consent banners** under URL scans). No effect on file scans |
+| `--no-consent-hiding` | URL scans only (Rust engine): leave known consent managers' banners, and a site's own cookie notices, on the page instead of hiding them before the scan (see **Consent banners** under URL scans). No effect on file scans |
| `--no-overlay-hiding` | URL scans only (Rust engine): leave product tours, site-builder badges and preloaders on the page, and skip the preloader wait (see **Tours and preloaders** under URL scans). No effect on file scans |
| `--fast` | deprecated, ignored; `stderr> Note: --fast is deprecated and ignored. The full scan is fast now and runs every rule.\n` |
| `--gpt`, `--gemini` | deprecated, ignored; `stderr> Note: --gpt and --gemini are deprecated and ignored. Generated-UI tells now run by default.\n` |
@@ -239,7 +239,7 @@ reports no findings and prints `stderr> Error: the page is ...`.
- text: `stderr> formatFindings(all,false) + '\n'`.
- `exit(hadOperationalFailure ? 1 : (primary.length > 0 ? 2 : 0))`.
- no findings: json → `stdout> []\n`; text/quiet → nothing. `exit(hadOperationalFailure ? 1 : 0)`.
-- Text mode (not `--json`, `--quiet` or `--github`) prints scan notes after the findings, or alone when there are none, one line each in first-seen order: the DESIGN.md purple note; for a URL scan that hid consent banners `Hid the <names> consent banner(s) on <url> before scanning. Pass --no-consent-hiding to scan it.` (`<names>` joined `A, B and C`); for one that hid tours or preloaders `Hid <items> on <url> before scanning. Pass --no-overlay-hiding to scan it.`, each item `the <library> tour`, `the <builder> badge` or `the preloader <name>`, joined the same way; and for a URL scan whose capture held sliders that never started, the capture note under `content-hidden-at-rest` below.
+- Text mode (not `--json`, `--quiet` or `--github`) prints scan notes after the findings, or alone when there are none, one line each in first-seen order: the DESIGN.md purple note; for a URL scan that hid consent banners `Hid the <names> consent banner(s) on <url> before scanning. Pass --no-consent-hiding to scan it.` (`<names>` joined `A, B and C`); for one that hid tours or preloaders `Hid <items> on <url> before scanning. Pass --no-overlay-hiding to scan it.`, each item `the <library> tour`, `the <builder> badge`, `the preloader <name>`, `the intro <name>` or `the splash <name>`, joined the same way (a site's own cookie notice is named `cookie notice` among the consent banners); and for a URL scan whose capture held sliders that never started, the capture note under `content-hidden-at-rest` below.
- Exit 1 takes precedence over exit 2: findings from the targets that did scan
do not turn a partial scan into a complete one (#711).
- Any other exit: `1` for arg errors above; uncaught exceptions propagate to `cli.js` catch (`exit 1`).
@@ -392,8 +392,8 @@ Optional keys added later by engines (appended after the above): `ignoreValue` (
- **Contrast ratios in snippets.** Every `low-contrast` producer (the element text path shared by both engines, which covers links, spans and placeholders, the static engine's `:hover state`, and the URL engine's `browser contrast` sampling and `pixel contrast` passes, verdict and median) prints a ratio against its threshold: one decimal; two when one decimal would round a failing ratio up to the threshold; and those two cut, not rounded, when rounding them would reach it too. A ratio under the bar never prints as the bar: `4.49:1 (need 4.5:1)`, never `4.5:1` or `4.50:1`. A ratio at or above the threshold, such as a median over it, prints one decimal.
- **Page validity gate.** After `goto` (and settle), before injecting anything, the engine classifies the page (`crates/browser/src/validity.rs`) from the main document's final CDP response and an in-page probe (title, visible text length, final URL, challenge-widget markers). Challenge: an `x-amzn-waf-action` header, `cf-mitigated: challenge`, a final URL on a challenge-only host (`perfdrive.com`, `captcha-delivery.com`), or, on a page with at most 3000 characters of visible text, a challenge title prefix ("Just a moment", "Attention Required! | Cloudflare", "Human Verification", "Access Denied", "Radware Bot Manager", "Captcha", ...) or a full-page widget marker (Cloudflare challenge form, PerimeterX, DataDome, Imperva, Akamai, AWS WAF, slider captchas). On a page of any size, a bot manager's challenge sheet laid over the rendered page is a challenge too: HUMAN Security's (PerimeterX's) "Press & hold" check, `#px-captcha-modal` or `#px-captcha-wrapper`, while it is showing (not `display: none`, not `visibility: hidden`, opacity over 0.02) and covers at least half the viewport; the signal reads `overlay human-press-and-hold`, and the probe records `overlays` only when one shows. HTTP error: a final status >= 400 with no challenge signal. A blocked page throws `the page is a bot challenge, not the site (<signals>). Findings would describe the challenge page, so none are reported.` or `the page returned an error (HTTP <status>). Findings would describe the error page, so none are reported.`, which the CLI prints as `Error: ...` and counts as an operational failure (exit 1). A `file://` load has no response, so only the probe signals apply.
Consent wall: a page where a known consent manager (next item) is showing (its text counted with the text of open shadow roots under its roots, where Usercentrics renders), hiding it would leave next to nothing (fewer than 20 visible characters outside its roots, and no visible form control (`input` other than hidden, `select`, `textarea`, `button`) and no `img`, `svg`, `video`, `canvas`, `iframe`, `object` or `embed` of 10,000 square pixels or more outside them), and the manager holds at least 100 characters or a frame of 10,000 square pixels or more (a message drawn in an iframe, whose text the page cannot read). For this test, text of the manager's that `body.innerText` does not see (rendered in a shadow root, or in a root appended outside `<body>`) is added to the page's visible-text count too (`consentShadowChars`), so the two counts describe the same text; the challenge checks keep the page's own count. It throws `the page is a consent wall, not the site (consent manager <names>, <n> of <total> visible characters outside it, no control or image outside it). Findings would describe the consent dialog, so none are reported.` A short page under an ordinary banner (a sign-in form, a splash page with a button, an image-first page) is scanned. The probe runs before any banner is hidden, and again in the same evaluation as each later hide pass (after the reveal sweep, right after the capture, and after the `content-hidden-at-rest` scroll probe when it scrolled the page), whenever a manager's root is in the page, with the earlier hide rules switched off and its inline hides lifted for that read (an inline hide the manager has since replaced with its own display, or with the same `display: none !important` written by rewriting its style attribute, stays as the manager set it), so a wall that arrives after load, fills a root that was an empty stub, or arrives during the capture or the scroll probe is refused too (the evidence then carries that later probe). A manager's box is showing when it has a size and paints (`checkVisibility` with opacity and visibility), and is not parked out of sight: a fixed box wholly outside the viewport (unless a transformed, filtered or contained ancestor holds it), a box wholly above or beside the document, or a box an ancestor's overflow clips away. Controls and media outside the roots are counted in the page's open shadow roots at any depth, nested web components included. With `--no-consent-hiding` the gate is off and the page is scanned with its banner, which is what that flag asks for. The probe object (evidence) carries `consent` (the names of the managers showing), `consentChars` (visible characters inside them) and `consentOutside` (visible controls and sizable media outside them, counted up to 20).
- - **Consent banners** (Rust engine). A consent banner covers copy a visitor reads once they dismiss it: text under it was skipped as covered or scored against the banner, and the banner's own text was scored as the site's. After the validity gate, again after the reveal sweep (so a banner injected after load or on the first scroll is caught before the capture), once more right after the capture (when that pass changes the page, the page is captured again, so the capture, the live hit tests and the pixel reads agree), and after the `content-hidden-at-rest` scroll probe when it scrolled the page (so a banner that scrolling injects is off the page for the pixel pass; the capture already read stands), the engine hides the roots and backdrops of the consent managers in `crates/browser/src/consent.rs`: OneTrust, Cookiebot, Usercentrics, TrustArc, Didomi, Quantcast Choice, Sourcepoint, Osano, the open-source Cookie Consent library, CookieYes, Complianz, iubenda, Termly, Axeptio, Borlabs Cookie (its box, its floating `#BorlabsCookieWidget` and its `#BorlabsDialogBackdrop`), Klaro, Cookie Notice, Shopify's privacy banner, consentmanager (`#cmpwrapper`, the host of the open shadow root its box renders in, and `#cmpbox`), Tealium (`#__tealiumGDPRecModal`, its consent prompt, and `#__tealiumGDPRcpPrefs`, its preference center), Transcend (`#transcend-consent-manager`, the zero-size host of the open shadow root its banner renders in), Enzuzo (`#ez-cookie-notification`, its banner, and `#enzuzo-modal-wrap`, its preference modal), and Google Funding Choices. Selectors are the vendor's own ids and classes, never a generic word, so a notice a site wrote for itself stays on the page and is scanned. Hiding is one injected `<style id="impeccable-consent-hide">` of `display: none !important` rules (plus an inline `display: none !important` on a matched element whose own inline style outranks the rule); nothing is clicked and no cookie or consent state is set. The scroll lock is undone only where the manager applied it: its own lock classes on `<html>` / `<body>` (Didomi `didomi-popup-open`, Sourcepoint `sp-message-open`, Enzuzo `ez-body-lock`) are removed, the `aria-hidden="true"` a manager put on the page behind its dialog is removed from exactly the elements it marked (Borlabs Cookie marks them `data-borlabs-cookie-aria-hidden`; reported in `unlocked` as `aria-hidden [<mark>]`), and an inline `overflow` / `overflow-y: hidden` on `<html>` or `<body>` is removed only while that manager's backdrop was showing the page is not an app shell (an element outside the managers at least half the viewport tall that scrolls itself with `overflow-y: auto` / `scroll`, whose body lock is the site's own), and no modal of the site's own (`dialog[open]`, `[aria-modal="true"]`, `[role="dialog"]`, `[role="alertdialog"]` outside the managers) is showing, since that modal may hold the lock. Every hide pass is best-effort: one that fails hides nothing and does not fail the scan. Every pass, the hit tests, and the evidence screenshot see the page without the banner (a last hide runs before the screenshot). Findings from a scan that hid a showing banner carry `consentHidden: ["<name>", ...]` (after `thirdParty`), and text mode prints the note above. `--no-consent-hiding` turns all of it off. The evidence API (`detect_url_evidence`) leaves the findings untagged, so they replay equal, and records `Evidence.consent`: `{ hidden, matched: { <name>: [selectors] }, unlocked }`. The static (file) engine is unaffected.
- - **Tours and preloaders** (Rust engine, `crates/browser/src/overlays.rs`). Right after the consent hide following the validity gate, the engine looks for a preloader still covering the page: a `position: fixed` layer other than `html` / `body` that covers at least 90% of the viewport, is what `elementFromPoint` returns (or contains it) at the center and at 20% / 80% of each axis (a layer with `pointer-events: none` is made hit-testable for that probe and put back), paints an opaque fill (alpha 0.9 or more) on itself or on a descendant covering as much, has at most 60 visible characters and no `a[href]`, `button`, visible `input`, `select`, `textarea`, `iframe`, `[role=button]`, dialog role, `aria-modal=true`, `dialog` or editable descendant, is not itself a dialog, and whose id or one of its classes names a loader (after trailing wrapper words such as `wrapper`, `overlay`, `screen`, `bg`, its last `-` / `_` word is `preloader`, `preload`, `preloading`, `loader`, `loading`, `pageloader`, `siteloader`, `loadingscreen` or `spinner`). If one is there the engine polls every 250ms for up to 5s for it to go on its own, then hides whatever is left with an inline `display: none !important` and marks it `data-impeccable-hidden="<name>"` (`<name>` is the tag plus the naming id or class, `div#preloader`). Known product tours are hidden by their library's own markup with one injected `<style id="impeccable-overlay-hide">`: driver.js 1.x (`.driver-popover`, `svg.driver-overlay`), whose `driver-active` / `driver-fade` / `driver-simple` body classes (its stylesheet sets `pointer-events: none` under `.driver-active`, which hides the page from hit tests), highlight classes (`driver-active-element`, `driver-no-interaction`) and highlight aria (`aria-controls="driver-popover-content"` with `aria-haspopup` and `aria-expanded`) are removed too. Site-builder badges are hidden by the builder's own markup in the same style: Lovable's "Edit with Lovable" badge (`#lovable-badge`). The hide runs at the same points as the consent hide (after the validity gate, after the reveal sweep, after the capture with a recapture when it changed the page, after the scroll probe when it ran, before the screenshot) and is as best-effort. A gate the visitor answers, a site's own dialog, and any layer with controls or more text are left on the page. Findings from a scan that hid any carry `overlaysHidden: [{ "kind": "tour" | "badge" | "preloader", "name": "<name>" }, ...]` (tours, then badges, then preloaders, after `consentHidden`), and text mode prints the note above. `consentHidden` is unchanged and lists consent managers only. When a preloader is hidden, the scroll lock its page kept with it is undone too: a loader-named class on `<html>` or `<body>` (`is-loading`) is removed, and so is an inline `overflow` / `overflow-y: hidden` on either unless a modal of the site's own is open or an app shell scrolls inside itself (either may hold that lock) (recorded in `unlocked` as `body.is-loading`, `body style overflow`). `--no-overlay-hiding` turns all of it off, the wait included. The evidence API leaves the findings untagged and records `Evidence.overlays`: `{ hidden: [{ kind, name }], matched: { <library or builder>: [selectors] }, unlocked, waitedMs }` (`waitedMs` is 0 when no preloader was covering the page).
+ - **Consent banners** (Rust engine). A consent banner covers copy a visitor reads once they dismiss it: text under it was skipped as covered or scored against the banner, and the banner's own text was scored as the site's. After the validity gate, again after the reveal sweep (so a banner injected after load or on the first scroll is caught before the capture), once more right after the capture (when that pass changes the page, the page is captured again, so the capture, the live hit tests and the pixel reads agree), and after the `content-hidden-at-rest` scroll probe when it scrolled the page (so a banner that scrolling injects is off the page for the pixel pass; the capture already read stands), the engine hides the roots and backdrops of the consent managers in `crates/browser/src/consent.rs`: OneTrust, Cookiebot, Usercentrics, TrustArc, Didomi, Quantcast Choice, Sourcepoint, Osano, the open-source Cookie Consent library, CookieYes, Complianz, iubenda, Termly, Axeptio, Borlabs Cookie (its box, its floating `#BorlabsCookieWidget` and its `#BorlabsDialogBackdrop`), Klaro, Cookie Notice, Shopify's privacy banner, consentmanager (`#cmpwrapper`, the host of the open shadow root its box renders in, and `#cmpbox`), Tealium (`#__tealiumGDPRecModal`, its consent prompt, and `#__tealiumGDPRcpPrefs`, its preference center), Transcend (`#transcend-consent-manager`, the zero-size host of the open shadow root its banner renders in), Enzuzo (`#ez-cookie-notification`, its banner, and `#enzuzo-modal-wrap`, its preference modal), Tarteaucitron (`#tarteaucitronRoot`, the zero-height host of `#tarteaucitronAlertBig`, and its small banner, progress bar, preference panel `#tarteaucitron`, backdrop `#tarteaucitronBack` and reopen icon), and Google Funding Choices. Selectors are the vendor's own ids and classes, never a generic word. A cookie notice a site wrote for itself is hidden at the same points, by what it does. It is found from a choice control: a `button`, `[role=button]`, button input, an `a` with no `href` or one that names only a fragment or `javascript:`, or an element with an `onclick` or `cursor: pointer`, whose whole label (at most 40 characters, case and trailing punctuation aside) is an accept or refuse phrase (`Accept`, `Accept all`, `Reject non-essential`, `Allow all cookies`, `Alle Cookies akzeptieren`, `Tout accepter`, `Aceptar todo`, `接受`, `동의`, `Принять` and the like); a softer label (`OK`, `Got it`, `Close`, `Dismiss`, `Understood`, `Schließen`, `Fermer`, ...) counts only when the notice's text is a consent sentence (a use verb before `cookie`, or a policy, settings or preferences word after it). A plain link is never a choice. The notice is the nearest ancestor of the control whose own text outside links and controls contains `cookie` (any case), widened through every ancestor that adds no visible text, control or media of its own, so a strip inside a site header or a bar stacked with a buy bar is hidden alone. It must sit on a layer (itself, an ancestor or a box the widening passed through `position: fixed`, or `position: absolute` covering at least 90% of the viewport), the control must be in the viewport and be what `elementFromPoint` returns at its centre, and the notice must hold no text, email, password or other entry `input` (checkboxes and radios are allowed), `select`, `textarea`, `h1` or `main`, carry at most 1,500 visible characters, and leave at least 200 on the page outside it (a page that is little more than its notice is read as before). It is hidden with an inline `display: none !important` and marked `data-impeccable-cookie-notice="<name>"` (`<name>` is the tag plus its id, else `[role=...]`, else its first class). A lock layer beside it is hidden and marked `lock <name>`: a sibling `div` or `span` with no element children and no text, `position: fixed`, covering at least 90% of the viewport, with no background image, a fill under alpha 0.9, a positive `z-index`, and what `elementFromPoint` returns at one of the five preloader probe points while the notice shows. When the notice covered at least half the viewport, or a lock layer went with it, an inline `filter` that is one `blur()` of 12px or less on `html`, `body`, or an element up to two levels below `body` outside the notice whose box covers at least half the viewport is removed (`unlocked`: `filter <tag>#<id>`), and so is an inline `overflow` / `overflow-y: hidden` on `html` or `body` when no other dialog is showing. These are reported under the name `cookie notice`, after the managers, with the hidden elements' names as its `matched` selectors. Hiding is one injected `<style id="impeccable-consent-hide">` of `display: none !important` rules (plus an inline `display: none !important` on a matched element whose own inline style outranks the rule); nothing is clicked and no cookie or consent state is set. The scroll lock is undone only where the manager applied it: its own lock classes on `<html>` / `<body>` (Didomi `didomi-popup-open`, Sourcepoint `sp-message-open`, Enzuzo `ez-body-lock`) are removed, the `aria-hidden="true"` a manager put on the page behind its dialog is removed from exactly the elements it marked (Borlabs Cookie marks them `data-borlabs-cookie-aria-hidden`; reported in `unlocked` as `aria-hidden [<mark>]`), and an inline `overflow` / `overflow-y: hidden` on `<html>` or `<body>` is removed only while that manager's backdrop was showing the page is not an app shell (an element outside the managers at least half the viewport tall that scrolls itself with `overflow-y: auto` / `scroll`, whose body lock is the site's own), and no modal of the site's own (`dialog[open]`, `[aria-modal="true"]`, `[role="dialog"]`, `[role="alertdialog"]` outside the managers) is showing, since that modal may hold the lock. Every hide pass is best-effort: one that fails hides nothing and does not fail the scan. Every pass, the hit tests, and the evidence screenshot see the page without the banner (a last hide runs before the screenshot). Findings from a scan that hid a showing banner carry `consentHidden: ["<name>", ...]` (after `thirdParty`; `cookie notice` for a site's own), and text mode prints the note above. `--no-consent-hiding` turns all of it off, the site's own cookie notices included. The evidence API (`detect_url_evidence`) leaves the findings untagged, so they replay equal, and records `Evidence.consent`: `{ hidden, matched: { <name>: [selectors] }, unlocked }`. The static (file) engine is unaffected.
+ - **Tours and preloaders** (Rust engine, `crates/browser/src/overlays.rs`). Right after the consent hide following the validity gate, the engine looks for a preloader still covering the page: a `position: fixed` layer other than `html` / `body` that covers at least 90% of the viewport, is what `elementFromPoint` returns (or contains it) at the center and at 20% / 80% of each axis (a layer with `pointer-events: none` is made hit-testable for that probe and put back), paints an opaque fill (alpha 0.9 or more) on itself or on a descendant covering as much, has at most 60 visible characters and no `a[href]`, `button`, visible `input`, `select`, `textarea`, `iframe`, `[role=button]`, dialog role, `aria-modal=true`, `dialog` or editable descendant, is not itself a dialog, and whose id or one of its classes names a loader (after trailing wrapper words such as `wrapper`, `overlay`, `screen`, `bg`, its last `-` / `_` word is `preloader`, `preload`, `preloading`, `loader`, `loading`, `pageloader`, `siteloader`, `loadingscreen` or `spinner`). A layer whose id or class names an intro instead (`intro`, `splash`, `splashscreen` as that last word) passes the same tests with up to 120 visible characters. An opaque fill is a colour at alpha 0.9 or more, or a `background-image` that is gradients only with every stop at alpha 0.9 or more. A layer whose text asks to be entered (below) is never one. If one is there the engine polls every 250ms for up to 5s (12s while an intro is among them) for it to go on its own, then hides whatever is left with an inline `display: none !important` and marks it `data-impeccable-hidden="<name>"` (`<name>` is the tag plus the naming id or class, `div#preloader`; an intro also carries `data-impeccable-hidden-kind="intro"`). An intro (not a loader-named layer) is waited for only when it stands in front of a page (below). A splash gate is hidden at the same points without a wait, and nothing is clicked: a `position: fixed` layer covering at least 90% of the viewport, on top at the same five points, with an opaque fill on itself or a covering descendant, at most 60 visible characters among whose words is `enter`, `entrer`, `entrez`, `entrar`, `entra`, `eintreten` or `betreten` (or that contain `进入`, `進入` or `입장`), with no `18`, `21`, `+18`, `age`, `âge`, `alter`, `edad`, `idade`, `cookie`, `accept` or `agree`, not a dialog and holding no visible `input`, `select`, `textarea`, `iframe`, `form`, dialog or editable descendant, with at most one `a[href]` / `button` / `[role=button]`, and either `cursor: pointer`, an `onclick` attribute, or one control whose label asks to be entered; and it must stand in front of a page: it holds no `h1`, the page shows at least 200 visible characters outside it, and, with the layer set to `visibility: hidden` for the probe (put back in the same task), `elementFromPoint` finds something of the page under it at one of the five probe points (an element with text of its own, a replaced element or control, or a box smaller than 90% of the viewport; not `html` or `body`), so a one-screen site or a hero the content scrolls over from 100vh stays. It is marked `data-impeccable-hidden="<name>"` and `data-impeccable-hidden-kind="splash"`, `<name>` being the tag plus its id or first class and up to 40 characters of its text in quotes (`div.fixed ("Enter NoteForge →")`). Known product tours are hidden by their library's own markup with one injected `<style id="impeccable-overlay-hide">`: driver.js 1.x (`.driver-popover`, `svg.driver-overlay`), whose `driver-active` / `driver-fade` / `driver-simple` body classes (its stylesheet sets `pointer-events: none` under `.driver-active`, which hides the page from hit tests), highlight classes (`driver-active-element`, `driver-no-interaction`) and highlight aria (`aria-controls="driver-popover-content"` with `aria-haspopup` and `aria-expanded`) are removed too. Site-builder badges are hidden by the builder's own markup in the same style: Lovable's "Edit with Lovable" badge (`#lovable-badge`). The hide runs at the same points as the consent hide (after the validity gate, after the reveal sweep, after the capture with a recapture when it changed the page, after the scroll probe when it ran, before the screenshot) and is as best-effort. A gate the visitor answers, a site's own dialog, and any layer with controls or more text are left on the page. Findings from a scan that hid any carry `overlaysHidden: [{ "kind": "tour" | "badge" | "preloader" | "intro" | "splash", "name": "<name>" }, ...]` (tours, then badges, then preloaders, after `consentHidden`), and text mode prints the note above. `consentHidden` is unchanged and lists consent managers (and `cookie notice`) only. When a preloader is hidden, the scroll lock its page kept with it is undone too: a loader-named class on `<html>` or `<body>` (`is-loading`) is removed, and so is an inline `overflow` / `overflow-y: hidden` on either unless a modal of the site's own is open or an app shell scrolls inside itself (either may hold that lock) (recorded in `unlocked` as `body.is-loading`, `body style overflow`). `--no-overlay-hiding` turns all of it off, the wait included. The evidence API leaves the findings untagged and records `Evidence.overlays`: `{ hidden: [{ kind, name }], matched: { <library or builder>: [selectors] }, unlocked, waitedMs }` (`waitedMs` is 0 when no preloader was covering the page).
- **What the visual pass refuses to read.** The JS reported whatever its sampling produced; the engine says nothing where the reading is not the text's own background. The candidate collector applies the element pass's text gates before a candidate takes one of the `maxCandidates` slots, is sampled, or is scrolled into view: text with no letter and no digit (`◯`, `{ }`, `/`) as well as emoji-only text; a disabled control (`[disabled]`, `[aria-disabled="true"]`); a computed font size under 1px; a `color` at alpha 0.02 or less, or a transparent `-webkit-text-fill-color`, unless the element clips its own background to its text; and an element the painted-at-capture predicate (`crates/core/src/browser/painted.rs`, text gate) says is not painted, such as a tab-strip cell past its clipping edge or a carousel slide parked beside the page. A background image read as a surface has to be under the text: an image drawn `no-repeat` (from the computed `background` shorthand's first layer) whose painted rect, at a `background-size` the capture can place (pixels, percentages, `cover`, or any size once the image's intrinsic size is loaded), covers neither the candidate's text box nor its own box (`body` and `html` are asked only about the text) ends the walk `background image does not cover the text` (`stop`), whether or not the pass could load the file. An icon sprite framing a count and a mark beside a button label are refused this way; a repeating tile and a placement the capture cannot state are read as before. In the stack walk (`impeccable_core::browser::visual`): a translucent surface no longer restarts the walk at its own parent (which re-entered the stack above the node it came from and composited that surface over itself until its alpha read as opaque, and which skipped siblings painted between the surface and that parent) — the walk keeps descending the one `elementsFromPoint` stack, collecting translucent surfaces until an opaque one grounds them, then composites them back in order (topmost surface still names the method, `...+alpha`); a walk that reaches the end of the stack with nothing opaque is unresolved rather than reporting the last translucent color as a surface. A gradient answers analytically only when its stops agree: any stop below 0.95 alpha (a scrim, a glow, a `from-x/10` wash composites differently at every point of the box) or two opaque stops more than 2× apart in contrast make it `gradient stops disagree`, and an `svg` in the stack makes it `<tag> paint`; both end the walk (`stop`) rather than letting the nodes under them answer for the text, so the candidate falls to the screenshot pass. In the screenshot flow: a candidate whose reasons include `background-clip text`, `filter`, or `backdrop filter` is refused before the two screenshots are taken; the verdict is the median over the *glyph cores* (channel delta ≥ 90% of the strongest delta in the box, ≥ 8 of them; when fewer than 8 pixels reach 90%, as on small or thin text, the pixels from 75% up) rather than the tenth percentile over every changed pixel, which antialiased edges drive to 1:1; and the pass reports nothing when the diff is not a glyph over its background — more than 55% of the clip changed (the page repainted), more than a quarter of the changed pixels moved the opposite way from the rest (text mid-animation leaves its old position and its new one in the same diff), most fully painted pixels are not the color the text declares (`preferRenderedForeground` aside, where the painted value *is* the claim), the surface under the glyphs stands 2:1 or further from the surface beside them in the same box (the page paints its own text twice, so hiding one copy leaves the other where the glyphs were), or the median of every measured pixel is more than 3× the verdict (the sample is two populations, not one surface). The snippet shape is unchanged. `median` in it is the median over the same glyph cores the verdict reads, so it prints the verdict's number and never reads below it (it used to be the median over every changed pixel, edges included, which printed verdicts above their own median such as `pixel contrast 3.5:1 median 1.7:1`). The median over every changed pixel still decides the bimodal refusal above, but it is not printed.
- **Viewport edges and overflow.** `body-text-viewport-edge` reports a gutter under 16px, or under 12px when `innerWidth` is 480px or less. A paragraph whose measured text runs past a side of the viewport (the distance rounds below 0) reports no gutter on that side; it still reports a gutter from 0px to the floor on the other side (`(left 8px)`). Those paragraphs, through the same gates plus the Text paint gate and inline ignores, report once per page instead: one `body-text-viewport-edge` finding attributed to the page (`selector` `body`, in `pageLevel`) on the side the furthest text reaches. The message follows what the page does. It reads `text runs past the <side> edge of the <vw>px viewport and is cut off: <name> reaches <d>px past it, with text in <n> block(s)` when the text is cut off: the viewport clips x overflow (the root's `overflow-x`, or body's when the root's is `visible`, at `hidden` or `clip`), the side is not the one the page scrolls to (right, or left under `direction: rtl`), the root's recorded `scrollWidth` does not exceed its `clientWidth` by more than 1px, or for every paragraph on that side a box at `overflow-x: hidden` or `clip` (the paragraph or an ancestor below the body, with its own edge on that side inside the viewport) is passed by the text. `<name>` is then the box reaching furthest among the paragraphs and their ancestors. Otherwise it reads `page scrolls sideways at <vw>px: <name> reaches <d>px past the <side> edge, and text in <n> block(s) runs past it`, where `<name>` is the box reaching furthest past that side among those no ancestor below the root clips or scrolls on x and not `position: fixed`, and no further than the page scrolls (ties go to the outer box). When the engine cannot tell (nothing it can see clips the text and the root recorded no `scrollWidth`) the sideways wording stands and `<name>` is the box reaching furthest among the paragraphs and their ancestors. In both wordings the paragraph itself is named when its text reaches further than any such box. `<name>` is the element's `class_selector`, except that a `div` with no class is named `div#<id>`, else `div in <tag>#<id>` or `div in <tag>.<class>` (at most three classes) after its nearest ancestor below the body with an id or a class, else `div ("<text>")` with up to 40 characters of its text, cut at a word and ended with `…` when cut, double quotes in the text written as `'`. `text-overflow` reports a spill only when it does harm: a box at `overflow-x: hidden` or `clip` (the element itself or an ancestor below the body, with area) is passed by the spill's reach, the spill reaches within a quarter em of the viewport's side or past it, or the spilled part comes within a quarter em of another element's text or painted box on the element's lines (not an ancestor or descendant, not a box that holds the element's whole box, and not a decoration layer: an absolutely or fixed positioned box with no text, other than a replaced element or an `svg`, that is 2px thick or less or paints only a plain fill, with no background image or border, at alpha times opacity under 0.25). The reach is the painted extent, or the scroll extent where that is taken as read; text that runs past its box into free space reports nothing.
- **Round 7 recall and gates** (corpus run 28). `line-length` and `body-text-viewport-edge` (its element and page-level forms) also measure prose written straight into a generic block: a `div`, `section`, `article`, `aside` or `main` laid out as `block` or `flow-root`, with more than 10 characters of its own text, only phrasing inside it, not set `white-space: pre*`, and outside any link, button, label, summary, select, textarea, button-, link-, tab-, menuitem- or option-role element and editable field; it is measured on its text runs only (where those cannot be measured it is not taken for a paragraph), and the edge snippet names it (`<div> with 228-char body ...`). The label collectors read the element that holds a label's text: its own text, else the one child whose text is not empty, at most three levels down, so a chip with an icon beside its text span is read through the span; `hero-eyebrow-chip` reads its sibling that way too, and its tracked-caps floor is 1.6px or 0.08em of the label's size; under 1.6px a label that is or holds a `time` element, or that names a year (1900 to 2099 as a word), is a dated meta line and not tracked caps (the recorded JS vectors pin the fixed floor alone). `kicker-above-heading` hands a label over a 48px-or-larger h1 to the hero rule at 1.6px, or, when the label is the h1's own previous sibling at 14px or less, at 0.08em where `hero-eyebrow-chip` reports that label (it does not read small-caps as capitals and passes over a dated line, so such a label stays a kicker; the static engine: at 14px or less). A card-context ancestor (`article`, `li`, `a`, `button`, ...) more than two viewports tall holds the page and is not a card for the kicker and numbered-label collectors. `icon-tile-stack` anchors on a card title set on a `div` or `span` too: laid out as a block, with no element children, 2 to 80 characters of its own text, weight 600 or more at 16px or more, outside any heading, link, button or label; it reads an `oklab()` or other modern tile fill. `tiny-text` skips a label typed in capitals (all its letters capitals, at most 40 letters, one line) and a run in a monospace face with `white-space: pre*`. `wide-tracking` counts a caps label's letters, not its characters, toward its 40-letter gate, and skips a one-line link or button label of at most 40 letters. The element contrast pass scores a box under 10px tall when it holds a line of its own text at 8px or more and is at least 0.9 of the font size tall. `ai-color-palette`'s gradient form skips a box whose gradient, sampled at nine points over the box from its computed size and position, shows one colour (every sample within 12 levels on each channel); an element reports the rule once: the computed gradient form stands for the utility-class gradient form, the computed purple-heading form for the class form (`text-purple-600 on heading`), and `gradient-text` on the element for both gradient forms. `gradient-text` skips a ramp whose strongest stop, times the element's own opacity, is under 0.15, and its stylesheet form does not stand when every element computing a clipped gradient is unpainted or under that floor. `gpt-thin-border-wide-shadow` reads, under one gradient ancestor with no picture, each of its stops composited over the fills below: a halo that shows over at most half of them does not count. `dark-glow`'s surface lift counts only layers carrying at least half the strength floor (1.5px of light), and its stylesheet form with no selector does not stand when an element's computed shadow carries the declaration: the element form read that element.
diff --git a/tests/fixtures/consent/bottom-stack.html b/tests/fixtures/consent/bottom-stack.html
new file mode 100644
index 000000000..c2e2471c7
--- /dev/null
+++ b/tests/fixtures/consent/bottom-stack.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>A cookie bar stacked with a buy bar</title>
+ <!-- The cookie bar goes and the buy bar stays. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+<div class="sticky-bottom" style="position:fixed;left:0;right:0;bottom:0;z-index:40;font:15px sans-serif"><div class="buy-bar" style="background:#fff;border-top:1px solid #ddd;padding:12px 20px;display:flex;justify-content:space-between;color:#aaa"><span id="own">Brown butter box, 12 pieces, $24</span><button style="background:#f0c;color:#fff;border:0;padding:8px 16px">Add to bag</button></div><div class="cookies" style="background:#111;color:#eee;padding:10px 20px">This site uses cookies. <button>Accept</button></div></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/header-strip.html b/tests/fixtures/consent/header-strip.html
new file mode 100644
index 000000000..4e7260763
--- /dev/null
+++ b/tests/fixtures/consent/header-strip.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>A cookie strip inside a fixed header</title>
+ <!-- The strip goes and the header with its nav stays. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<header class="site-header" style="position:fixed;top:0;left:0;right:0;z-index:20;background:#fff;font:15px sans-serif;box-shadow:0 1px 4px rgba(0,0,0,.1)"><div class="cookie-strip" style="background:#222;color:#eee;padding:8px 20px">We use cookies for analytics. <button>OK</button></div><div style="display:flex;gap:20px;padding:14px 20px;align-items:center"><span class="logo" id="own" style="color:#bbb;font-weight:700">Northwind</span><a href="#p" style="color:#bbb">Products</a><a href="#pr" style="color:#bbb">Pricing</a></div></header>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+</body>
+</html>
diff --git a/tests/fixtures/consent/site-lock-blur.html b/tests/fixtures/consent/site-lock-blur.html
new file mode 100644
index 000000000..cb750b55b
--- /dev/null
+++ b/tests/fixtures/consent/site-lock-blur.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Consent hiding: a cookie lock that blurs the page</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ /* A ktk.de-shaped lock (corpus run 1006): the notice is a role=dialog box
+ in a fixed layer, an empty transparent fixed layer beside it takes the
+ hit tests below it, and the page wrapper carries an inline
+ filter: blur(4px). The URL engine hides
+ the layer and the empty lock and removes the blur; the small blurred
+ decoration #deco keeps its own. Pinned by
+ crates/browser/tests/consent_hiding.rs. */
+ #lock { position: fixed; inset: 0; z-index: 9008; }
+ #block { position: fixed; top: 0; left: 0; right: 0; z-index: 9010; }
+ .text { position: relative; z-index: 9012; width: 640px; margin: 30px auto; padding: 24px; background: #ffffff; }
+ .text p { margin: 0 0 12px; font-size: 14px; color: #b0b0b0; }
+ </style>
+</head>
+<body>
+ <div id="page" style="filter: blur(4px); min-height: 100vh;">
+ <h1>A page under a cookie lock</h1>
+ <p class="body-copy">This page has enough copy of its own to be a page and not a consent wall. It describes a product, its pricing and its support hours, and a visitor reads it once the notice below is out of the way. The notice is the site's own, written without any consent manager's markup.</p>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 700px; left: 80px; width: 520px;">Faint copy the notice covers.</p>
+ <a href="#" id="covered-cta" style="position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px; background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;">Start free trial</a>
+ </div>
+ <div id="deco" style="filter: blur(8px); width: 120px; height: 120px; background: #ffd400;"></div>
+ <div id="lock"></div>
+ <div id="block">
+ <div class="text" role="dialog">
+ <p id="notice-text">Diese Website verwendet Cookies. Wir verwenden Cookies, die für die Funktion unserer Webseiten notwendig sind.</p>
+ <button type="submit">Alle Cookies akzeptieren</button>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/site-login.html b/tests/fixtures/consent/site-login.html
new file mode 100644
index 000000000..cff02ae0d
--- /dev/null
+++ b/tests/fixtures/consent/site-login.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Consent hiding: a sign-in modal stays</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ .modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); z-index: 10000; }
+ .card { width: 480px; padding: 32px; background: #ffffff; border-radius: 12px; }
+ .card p { margin: 0 0 12px; font-size: 14px; color: #b0b0b0; }
+ /* A sign-in modal that mentions the cookie it sets: it holds a password
+ field, so it is not a cookie notice and stays. Pinned by
+ crates/browser/tests/consent_hiding.rs. */
+ </style>
+</head>
+<body>
+ <h1>A page under a sign-in modal</h1>
+ <p class="body-copy">This page has enough copy of its own to be a page and not a consent wall. It describes a product, its pricing and its support hours, and a visitor reads it once the notice below is out of the way. The notice is the site's own, written without any consent manager's markup.</p>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 700px; left: 80px; width: 520px;">Faint copy the notice covers.</p>
+ <a href="#" id="covered-cta" style="position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px; background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;">Start free trial</a>
+ <div class="modal" role="dialog" aria-modal="true">
+ <div class="card">
+ <p id="modal-text">Sign in. Staying signed in keeps a cookie on this device.</p>
+ <input type="text" placeholder="Name">
+ <input type="password" placeholder="Password">
+ <button type="button">OK</button>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/site-newsletter.html b/tests/fixtures/consent/site-newsletter.html
new file mode 100644
index 000000000..acfc070b9
--- /dev/null
+++ b/tests/fixtures/consent/site-newsletter.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Consent hiding: a newsletter modal stays</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ .modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); z-index: 10000; }
+ .card { width: 480px; padding: 32px; background: #ffffff; border-radius: 12px; }
+ .card p { margin: 0 0 12px; font-size: 14px; color: #b0b0b0; }
+ /* A newsletter modal whose text mentions cookies and whose button says
+ "No thanks": it holds an email field, so it is not a cookie notice and
+ stays. Pinned by crates/browser/tests/consent_hiding.rs. */
+ </style>
+</head>
+<body>
+ <h1>A page under a newsletter modal</h1>
+ <p class="body-copy">This page has enough copy of its own to be a page and not a consent wall. It describes a product, its pricing and its support hours, and a visitor reads it once the notice below is out of the way. The notice is the site's own, written without any consent manager's markup.</p>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 700px; left: 80px; width: 520px;">Faint copy the notice covers.</p>
+ <a href="#" id="covered-cta" style="position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px; background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;">Start free trial</a>
+ <div class="modal" role="dialog" aria-modal="true">
+ <div class="card">
+ <p id="modal-text">Join the newsletter. We set a cookie so this box does not show again.</p>
+ <input type="email" placeholder="[email protected]">
+ <button type="button">Subscribe</button>
+ <button type="button">No thanks, close</button>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/site-notice-contents.html b/tests/fixtures/consent/site-notice-contents.html
new file mode 100644
index 000000000..3523f6cac
--- /dev/null
+++ b/tests/fixtures/consent/site-notice-contents.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Consent hiding: a site notice whose text sits in a display: contents span</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ /* A blueeyes.com.tw-shaped notice (corpus run 1006): the site's own
+ fixed bar, generic names, no dialog role, a translucent dark fill, over
+ the copy at the foot of the first screen. Its text names cookies and it
+ offers a consent choice, so the URL engine hides it and scores the copy
+ under it. Pinned by crates/browser/tests/consent_hiding.rs. */
+ .cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; height: 170px; padding: 24px 40px;
+ background: rgba(0, 0, 0, 0.8); z-index: 9999; }
+ .cookie-banner p { margin: 0 0 12px; max-width: 760px; font-size: 14px; color: #666666; }
+ </style>
+</head>
+<body>
+ <!-- The site's own notice, its sentence inside a display: contents span (no box of its own). Greptile probe on #1106, pinned by crates/browser/tests/consent_hiding.rs. -->
+ <h1>A page under the site's own cookie notice</h1>
+ <p class="body-copy">This page has enough copy of its own to be a page and not a consent wall. It describes a product, its pricing and its support hours, and a visitor reads it once the notice below is out of the way. The notice is the site's own, written without any consent manager's markup.</p>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 700px; left: 80px; width: 520px;">Faint copy the notice covers.</p>
+ <a href="#" id="covered-cta" style="position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px; background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;">Start free trial</a>
+ <div class="cookie-banner" id="cookieBanner">
+ <span id="notice-text" style="display: contents;">By clicking Accept you agree to our use of cookies to improve the site. See the <a href="#">privacy policy</a>.</span>
+ <button type="button">Accept</button>
+ </div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/site-notice-short.html b/tests/fixtures/consent/site-notice-short.html
new file mode 100644
index 000000000..e0eb06876
--- /dev/null
+++ b/tests/fixtures/consent/site-notice-short.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Consent hiding: a short page under its own cookie notice</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ /* The same notice over a page with under 200 characters of its own: a
+ page that is little more than its notice is a consent wall, and the
+ notice stays. Pinned by crates/browser/tests/consent_hiding.rs. */
+ .cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; height: 170px; padding: 24px 40px;
+ background: #ffffff; border-top: 1px solid #d0d7de; z-index: 50; }
+ .cookie-banner p { margin: 0 0 12px; max-width: 760px; font-size: 14px; color: #b0b0b0; }
+ </style>
+</head>
+<body>
+ <h1>A short page</h1>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 700px; left: 80px; width: 520px;">Faint copy the notice covers.</p>
+ <a href="#" id="covered-cta" style="position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px; background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;">Start free trial</a>
+ <div class="cookie-banner" id="cookie-consent">
+ <p id="notice-text">We use cookies to keep you signed in and to count visits.</p>
+ <button type="button">Accept</button>
+ </div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/site-notice.html b/tests/fixtures/consent/site-notice.html
index 7fe5eb3e6..74c64476b 100644
--- a/tests/fixtures/consent/site-notice.html
+++ b/tests/fixtures/consent/site-notice.html
@@ -3,28 +3,29 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Consent hiding: a notice the site wrote itself</title>
+ <title>Consent hiding: a cookie notice the site wrote itself</title>
<style>
- /* A cookie notice the site wrote itself: generic class names ("cookie",
- "consent", "banner"), no known vendor. It is part of the site, so the
- URL engine leaves it on the page: the copy it covers is not scored and
- its own faint text is. Pinned by crates/browser/tests/consent_hiding.rs. */
* { box-sizing: border-box; }
body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
- .faint { position: absolute; top: 700px; left: 80px; width: 520px; margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
- .cta { position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px;
- background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ /* A blueeyes.com.tw-shaped notice (corpus run 1006): the site's own
+ fixed bar, generic names, no dialog role, a translucent dark fill, over
+ the copy at the foot of the first screen. Its text names cookies and it
+ offers a consent choice, so the URL engine hides it and scores the copy
+ under it. Pinned by crates/browser/tests/consent_hiding.rs. */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; height: 170px; padding: 24px 40px;
- background: #ffffff; border-top: 1px solid #d0d7de; z-index: 50; }
- .cookie-banner p { margin: 0 0 12px; max-width: 760px; font-size: 14px; color: #b0b0b0; }
+ background: rgba(0, 0, 0, 0.8); z-index: 9999; }
+ .cookie-banner p { margin: 0 0 12px; max-width: 760px; font-size: 14px; color: #666666; }
</style>
</head>
<body>
<h1>A page under the site's own cookie notice</h1>
- <p class="faint" id="covered-copy">Faint copy the site's notice covers.</p>
- <a href="#" class="cta" id="covered-cta">Start free trial</a>
- <div class="cookie-banner" id="cookie-consent" data-cookie-consent="true">
- <p id="notice-text">We use cookies to keep you signed in and to count visits.</p>
+ <p class="body-copy">This page has enough copy of its own to be a page and not a consent wall. It describes a product, its pricing and its support hours, and a visitor reads it once the notice below is out of the way. The notice is the site's own, written without any consent manager's markup.</p>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 700px; left: 80px; width: 520px;">Faint copy the notice covers.</p>
+ <a href="#" id="covered-cta" style="position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px; background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;">Start free trial</a>
+ <div class="cookie-banner" id="cookieBanner">
+ <p id="notice-text">By clicking Accept you agree to our use of cookies to improve the site. See the <a href="#">privacy policy</a>.</p>
<button type="button">Accept</button>
</div>
</body>
diff --git a/tests/fixtures/consent/site-policy-link.html b/tests/fixtures/consent/site-policy-link.html
new file mode 100644
index 000000000..fcb70b0ad
--- /dev/null
+++ b/tests/fixtures/consent/site-policy-link.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Consent hiding: a bar that only links a cookie policy stays</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ /* A fixed promo bar that links a cookie policy and has a Close button:
+ cookies are named only inside a link, so it is not a cookie notice and
+ stays. Pinned by crates/browser/tests/consent_hiding.rs. */
+ .bar { position: fixed; left: 0; right: 0; bottom: 0; height: 170px; padding: 24px 40px; background: #ffffff; border-top: 1px solid #d0d7de; z-index: 9999; }
+ .bar p { margin: 0 0 12px; font-size: 14px; color: #b0b0b0; }
+ </style>
+</head>
+<body>
+ <h1>A page under a promo bar</h1>
+ <p class="body-copy">This page has enough copy of its own to be a page and not a consent wall. It describes a product, its pricing and its support hours, and a visitor reads it once the notice below is out of the way. The notice is the site's own, written without any consent manager's markup.</p>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 700px; left: 80px; width: 520px;">Faint copy the notice covers.</p>
+ <a href="#" id="covered-cta" style="position: absolute; top: 740px; left: 80px; display: inline-block; padding: 8px 16px; border-radius: 6px; background: #ff7145; color: #ffffff; font-size: 15px; font-weight: 500; text-decoration: none;">Start free trial</a>
+ <div class="bar">
+ <p id="modal-text">Summer sale: 20% off every plan this week. Read our <a href="#">cookie policy</a>.</p>
+ <button type="button">Close</button>
+ </div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-announce.html b/tests/fixtures/consent/stay-announce.html
new file mode 100644
index 000000000..82cbee308
--- /dev/null
+++ b/tests/fixtures/consent/stay-announce.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a promo bar about cookies (the food)</title>
+ <!-- A fixed promo bar whose text says cookies and whose button says Dismiss: no consent sentence, so it is not a cookie notice. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<div class="announcement-bar" style="position:fixed;top:0;left:0;right:0;z-index:50;background:#f4e3c8;color:#b49a7a;font:15px sans-serif;padding:10px 16px;display:flex;justify-content:space-between"><span id="own">Free cookies with every order over $30 this week only.</span><button style="background:none;border:0;color:#b49a7a">Dismiss</button></div>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-bg-canvas.html b/tests/fixtures/consent/stay-bg-canvas.html
new file mode 100644
index 000000000..2a0483e73
--- /dev/null
+++ b/tests/fixtures/consent/stay-bg-canvas.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a fixed canvas background beside a cookie bar</title>
+ <!-- A fixed full-screen canvas is never a lock layer. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<canvas id="stars" style="position:fixed;inset:0;width:100vw;height:100vh;z-index:-1"></canvas><script>const c=document.getElementById("stars");c.width=innerWidth;c.height=innerHeight;const x=c.getContext("2d");x.fillStyle="#0b1020";x.fillRect(0,0,c.width,c.height);</script>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:40px 24px;font:18px/1.6 sans-serif;color:#f2f4ff"><h1 id="night-title">Nightfield</h1><p>Nightfield is a quiet observatory app. It maps the sky above you, names what you are looking at, and keeps a log of every clear night. It works offline and keeps your location on your device.</p><p>Download it for free and try it under the next clear sky. The full star catalogue is included with no subscription.</p></main>
+<div class="cookie-bar" style="position:fixed;left:0;right:0;bottom:0;background:#111;color:#eee;padding:12px 20px;font:14px sans-serif;z-index:10">We use cookies to measure visits. <button>Accept</button> <button>Decline</button></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-bg-image.html b/tests/fixtures/consent/stay-bg-image.html
new file mode 100644
index 000000000..019222b7e
--- /dev/null
+++ b/tests/fixtures/consent/stay-bg-image.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a fixed image background beside a cookie bar</title>
+ <!-- An empty fixed full-screen image background is not a lock layer; hiding it would leave light text on white. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<div class="page-bg" style="position:fixed;inset:0;z-index:-1;background:url(&quot;data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Crect width='10' height='10' fill='%230b1020'/%3E%3C/svg%3E&quot;) center/cover"></div>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:40px 24px;font:18px/1.6 sans-serif;color:#f2f4ff"><h1 id="night-title">Nightfield</h1><p>Nightfield is a quiet observatory app. It maps the sky above you, names what you are looking at, and keeps a log of every clear night. It works offline and keeps your location on your device.</p><p>Download it for free and try it under the next clear sky. The full star catalogue is included with no subscription.</p></main>
+<div class="cookie-bar" style="position:fixed;left:0;right:0;bottom:0;background:#111;color:#eee;padding:12px 20px;font:14px sans-serif;z-index:10">We use cookies to measure visits. <button>Accept</button> <button>Decline</button></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-bg-layer.html b/tests/fixtures/consent/stay-bg-layer.html
new file mode 100644
index 000000000..03fd6a778
--- /dev/null
+++ b/tests/fixtures/consent/stay-bg-layer.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a fixed page background beside a cookie bar</title>
+ <!-- An empty fixed full-screen gradient behind the page is not a lock layer. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<div class="page-bg" style="position:fixed;inset:0;z-index:-1;background:linear-gradient(160deg,#0b1020,#1d2b5a)"></div>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:40px 24px;font:18px/1.6 sans-serif;color:#f2f4ff"><h1 id="night-title">Nightfield</h1><p>Nightfield is a quiet observatory app. It maps the sky above you, names what you are looking at, and keeps a log of every clear night. It works offline and keeps your location on your device.</p><p>Download it for free and try it under the next clear sky. The full star catalogue is included with no subscription.</p></main>
+<div class="cookie-bar" style="position:fixed;left:0;right:0;bottom:0;background:#111;color:#eee;padding:12px 20px;font:14px sans-serif;z-index:10">We use cookies to measure visits. <button>Accept</button> <button>Decline</button></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-blur-deco-absolute.html b/tests/fixtures/consent/stay-blur-deco-absolute.html
new file mode 100644
index 000000000..1d01e6fd6
--- /dev/null
+++ b/tests/fixtures/consent/stay-blur-deco-absolute.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: an absolute blurred decoration beside a cookie bar</title>
+ <!-- Same, absolutely positioned over the first screen. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<div class="aurora" style="position:absolute;top:0;left:0;width:100%;height:100vh;z-index:-1;filter:blur(80px);background:radial-gradient(circle at 30% 30%,#ff9ad5,transparent 60%),radial-gradient(circle at 70% 60%,#8ad4ff,transparent 60%)"></div>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+<div class="cookie-bar" style="position:fixed;left:0;right:0;bottom:0;background:#111;color:#eee;padding:12px 20px;font:14px sans-serif;z-index:10">We use cookies to measure visits. <button>Accept</button> <button>Decline</button></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-blur-deco.html b/tests/fixtures/consent/stay-blur-deco.html
new file mode 100644
index 000000000..40133399f
--- /dev/null
+++ b/tests/fixtures/consent/stay-blur-deco.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a fixed blurred decoration beside a cookie bar</title>
+ <!-- An 80px blur is a decoration, and a bottom bar is not a lock. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<div class="aurora" style="position:fixed;inset:-10%;z-index:-1;filter:blur(80px);background:radial-gradient(circle at 30% 30%,#ff9ad5,transparent 60%),radial-gradient(circle at 70% 60%,#8ad4ff,transparent 60%)"></div>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+<div class="cookie-bar" style="position:fixed;left:0;right:0;bottom:0;background:#111;color:#eee;padding:12px 20px;font:14px sans-serif;z-index:10">We use cookies to measure visits. <button>Accept</button> <button>Decline</button></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-blur-paywall.html b/tests/fixtures/consent/stay-blur-paywall.html
new file mode 100644
index 000000000..5acc0a3a9
--- /dev/null
+++ b/tests/fixtures/consent/stay-blur-paywall.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a blurred paywall teaser beside a cookie bar</title>
+ <!-- A 5px blur on a teaser is the site's; a bottom bar is not a lock, so the blur stays. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<article class="teaser" style="filter:blur(5px);padding:24px;font:18px/1.6 Georgia,serif;color:#222;min-height:90vh"><h1>Inside the harbour deal</h1><p>The council met on Tuesday to vote on the lease. Members argued for three hours over the berth fees and the dredging schedule, and the final vote came close to midnight. What follows is the full account of how the deal changed in its last week.</p><p>Subscribers can read the full story.</p></article>
+<div class="paywall" style="position:absolute;left:0;right:0;top:40vh;background:#fff;padding:24px;text-align:center;font:16px sans-serif">Subscribe to keep reading. <a href="#s">Subscribe</a></div>
+<div class="cookie-bar" style="position:fixed;left:0;right:0;bottom:0;background:#111;color:#eee;padding:12px 20px;font:14px sans-serif;z-index:10">We use cookies to measure visits. <button>Accept</button> <button>Decline</button></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-cart.html b/tests/fixtures/consent/stay-cart.html
new file mode 100644
index 000000000..65842d2af
--- /dev/null
+++ b/tests/fixtures/consent/stay-cart.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a cart drawer</title>
+ <!-- A cart drawer open at load listing cookies, with a Close button: no consent sentence. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<aside class="cart-drawer" style="position:fixed;top:0;right:0;bottom:0;width:340px;z-index:100;background:#fff;box-shadow:0 0 20px rgba(0,0,0,.2);padding:20px;font:15px sans-serif;color:#aaa"><h2 id="own" style="color:#aaa">Your bag</h2><div>Oatmeal raisin cookie <button>-</button> 2 <button>+</button> $6.00</div><div>Double chocolate cookie <button>-</button> 1 <button>+</button> $3.50</div><p>Subtotal $9.50</p><button style="color:#aaa;background:#eee">Close</button> <a href="#checkout" style="color:#aaa">Checkout</a></aside>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-gdpr-modal.html b/tests/fixtures/consent/stay-gdpr-modal.html
new file mode 100644
index 000000000..b9b7130b7
--- /dev/null
+++ b/tests/fixtures/consent/stay-gdpr-modal.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a help modal about cookies</title>
+ <!-- A help modal that explains cookie consent, with Got it: about cookies, not asking for consent. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+<div class="explainer" role="dialog" style="position:fixed;top:20%;left:50%;transform:translateX(-50%);width:420px;background:#fff;box-shadow:0 10px 40px rgba(0,0,0,.3);padding:24px;font:15px sans-serif;z-index:30;color:#999"><h2>How GDPR applies to your shop</h2><p id="own">Under GDPR, a cookie that tracks a visitor needs consent. Analytics tools that set a cookie count. This guide walks through what your store needs.</p><button>Got it</button></div>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-header.html b/tests/fixtures/consent/stay-header.html
new file mode 100644
index 000000000..75eddd1fd
--- /dev/null
+++ b/tests/fixtures/consent/stay-header.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a bakery header</title>
+ <!-- A fixed site header whose brand says Cookies and whose nav has an Essentials link: links are never a choice. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<header style="position:fixed;top:0;left:0;right:0;z-index:20;background:#2b1d14;color:#6e5a4a;font:15px sans-serif;padding:14px 20px;display:flex;gap:24px;align-items:center"><span class="brand" id="own">Crumb &amp; Co. Cookies</span><nav style="display:flex;gap:16px"><a href="#shop" style="color:#6e5a4a">Shop</a><a href="#e" style="color:#6e5a4a">Essentials</a><a href="#g" style="color:#6e5a4a">Gift boxes</a></nav></header>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+</body>
+</html>
diff --git a/tests/fixtures/consent/stay-hidden-policy.html b/tests/fixtures/consent/stay-hidden-policy.html
new file mode 100644
index 000000000..e60630388
--- /dev/null
+++ b/tests/fixtures/consent/stay-hidden-policy.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a welcome bar holding a hidden cookie policy</title>
+ <!-- A fixed welcome bar with a Close button whose wrapper also holds a hidden cookie-policy panel. The bar shows no consent notice, so it stays. Greptile probe on #1106, pinned by crates/browser/tests/consent_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<div class="site-bar" style="position:fixed;left:0;right:0;bottom:0;z-index:100;background:#fff;box-shadow:0 0 20px rgba(0,0,0,.2);padding:20px;font:15px sans-serif;color:#aaa"><div class="policy" style="display:none">We use cookies to improve your experience. Read our cookie policy to learn more.</div><div class="welcome"><p id="own" style="color:#aaa">Welcome back. New arrivals land every Thursday morning.</p><button style="color:#aaa;background:#eee">Close</button></div></div>
+<main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main>
+</body>
+</html>
diff --git a/tests/fixtures/consent/tarteaucitron.html b/tests/fixtures/consent/tarteaucitron.html
new file mode 100644
index 000000000..34d063eeb
--- /dev/null
+++ b/tests/fixtures/consent/tarteaucitron.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Consent hiding: Tarteaucitron</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0 0 12px; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .body-copy { max-width: 640px; }
+ /* A bordeaux-metropole.fr-shaped Tarteaucitron banner (corpus run 1006):
+ a zero-height #tarteaucitronRoot holding the fixed #tarteaucitronAlertBig
+ (role=dialog, aria-modal) in the middle of the first screen. Pinned by
+ crates/browser/tests/consent_hiding.rs. */
+ #tarteaucitronRoot { position: absolute; top: 0; left: 0; width: 100%; height: 0; }
+ #tarteaucitronAlertBig { position: fixed; top: 200px; left: 315px; width: 650px; padding: 24px; background: #ffcc00; z-index: 2147483645; }
+ #tarteaucitronAlertBig p { margin: 0; font-size: 14px; color: #ffffff; }
+ </style>
+</head>
+<body>
+ <h1>A page under Tarteaucitron</h1>
+ <p class="body-copy">This page has enough copy of its own to be a page and not a consent wall. It describes a product, its pricing and its support hours, and a visitor reads it once the notice below is out of the way. The notice is the site's own, written without any consent manager's markup.</p>
+ <p class="faint" id="covered-copy" style="position: absolute; top: 260px; left: 340px; width: 520px;">Faint copy the banner covers.</p>
+ <div id="tarteaucitronRoot">
+ <div id="tarteaucitronAlertBig" role="dialog" aria-modal="true">
+ <p id="tarteaucitronDisclaimerAlert">Ce site utilise des cookies et vous donne le contrôle sur ceux que vous souhaitez activer</p>
+ <button type="button">Tout accepter</button>
+ <button type="button">Tout refuser</button>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/age-gate.html b/tests/fixtures/overlays/age-gate.html
new file mode 100644
index 000000000..5e694eefd
--- /dev/null
+++ b/tests/fixtures/overlays/age-gate.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Overlay hiding: an age gate stays</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ /* An age gate on the same kind of layer: it asks a question with two
+ answers, so it is not a splash and stays. Pinned by
+ crates/browser/tests/overlay_hiding.rs. */
+ .splash { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #000; color: #fff; cursor: pointer; }
+ #gate-hint { color: #333; font-size: 14px; }
+ </style>
+</head>
+<body>
+ <div class="splash"><p id="gate-hint">Are you 18? Enter</p><button type="button">Yes</button><button type="button">No</button></div>
+ <h1>A page under an age gate</h1>
+ <p class="faint" id="covered-copy">Faint copy the gate covers.</p>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/intro-age-gate.html b/tests/fixtures/overlays/intro-age-gate.html
new file mode 100644
index 000000000..b7b373541
--- /dev/null
+++ b/tests/fixtures/overlays/intro-age-gate.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Overlay hiding: a long named age gate</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .cine-intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; color: #fff;
+ background: radial-gradient(130% 120% at 50% 28%, rgb(11, 22, 38) 0%, rgb(4, 5, 7) 70%); }
+ /* The same intro, never removed: the URL engine waits the intro budget,
+ then hides it. Pinned by crates/browser/tests/overlay_hiding.rs. */
+ </style>
+</head>
+<body>
+ <div class="cine-intro" onclick="void 0" aria-hidden="true"><div><b>TIRIONAI</b><p>Enter when the rendering is done, about a minute. You must be 18 or older. RENDERING 47%</p></div></div>
+ <h1>A page under an intro</h1>
+ <p class="body-copy" style="max-width: 640px;">This page has copy of its own under the layer: a product, its pricing, its support hours and a note on shipping. A visitor reads it once the layer in front of it is gone, and the scan should read it too. It runs long enough to be more than a title.</p>
+ <p class="faint" id="covered-copy">Faint copy the intro covers.</p>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/intro-clears.html b/tests/fixtures/overlays/intro-clears.html
new file mode 100644
index 000000000..977ce4335
--- /dev/null
+++ b/tests/fixtures/overlays/intro-clears.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Overlay hiding: an intro that ends on its own</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .cine-intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; color: #fff;
+ background: radial-gradient(130% 120% at 50% 28%, rgb(11, 22, 38) 0%, rgb(4, 5, 7) 70%); }
+ /* A tirionai.com-shaped intro (corpus run 1006): `div.cine-intro`, fixed,
+ a radial-gradient fill and no background colour, a brand line and a
+ progress count (61 characters), gone after 1.5 seconds. The URL engine
+ waits for it and hides nothing. Pinned by
+ crates/browser/tests/overlay_hiding.rs. */
+ </style>
+</head>
+<body>
+ <div class="cine-intro" aria-hidden="true"><div><b>TIRIONAI</b><p>For the places you can't always watch. RENDERING <span id="pct">0</span>%</p></div></div>
+ <h1>A page under an intro</h1>
+ <p class="body-copy" style="max-width: 640px;">This page has copy of its own under the layer: a product, its pricing, its support hours and a note on shipping. A visitor reads it once the layer in front of it is gone, and the scan should read it too. It runs long enough to be more than a title.</p>
+ <p class="faint" id="covered-copy">Faint copy the intro covers.</p>
+ <script>
+ let n = 0;
+ const t = setInterval(() => { n += 10; document.getElementById('pct').textContent = n; }, 150);
+ setTimeout(() => { clearInterval(t); document.querySelector('.cine-intro').remove(); }, 1500);
+ </script>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/intro-enter-text.html b/tests/fixtures/overlays/intro-enter-text.html
new file mode 100644
index 000000000..f7fcde6c5
--- /dev/null
+++ b/tests/fixtures/overlays/intro-enter-text.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Overlay hiding: an intro that never ends</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .cine-intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; color: #fff;
+ background: radial-gradient(130% 120% at 50% 28%, rgb(11, 22, 38) 0%, rgb(4, 5, 7) 70%); }
+ /* The same intro, never removed: the URL engine waits the intro budget,
+ then hides it. Pinned by crates/browser/tests/overlay_hiding.rs. */
+ </style>
+</head>
+<body>
+ <div class="cine-intro" aria-hidden="true"><div><b>TIRIONAI</b><p>For the places you can't always watch. Enter when the rendering is done, about a minute. RENDERING 47%</p></div></div>
+ <h1>A page under an intro</h1>
+ <p class="body-copy" style="max-width: 640px;">This page has copy of its own under the layer: a product, its pricing, its support hours and a note on shipping. A visitor reads it once the layer in front of it is gone, and the scan should read it too. It runs long enough to be more than a title.</p>
+ <p class="faint" id="covered-copy">Faint copy the intro covers.</p>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/intro-stuck.html b/tests/fixtures/overlays/intro-stuck.html
new file mode 100644
index 000000000..0a30e65e3
--- /dev/null
+++ b/tests/fixtures/overlays/intro-stuck.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Overlay hiding: an intro that never ends</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ .cine-intro { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; color: #fff;
+ background: radial-gradient(130% 120% at 50% 28%, rgb(11, 22, 38) 0%, rgb(4, 5, 7) 70%); }
+ /* The same intro, never removed: the URL engine waits the intro budget,
+ then hides it. Pinned by crates/browser/tests/overlay_hiding.rs. */
+ </style>
+</head>
+<body>
+ <div class="cine-intro" aria-hidden="true"><div><b>TIRIONAI</b><p>For the places you can't always watch. RENDERING 47%</p></div></div>
+ <h1>A page under an intro</h1>
+ <p class="body-copy" style="max-width: 640px;">This page has copy of its own under the layer: a product, its pricing, its support hours and a note on shipping. A visitor reads it once the layer in front of it is gone, and the scan should read it too. It runs long enough to be more than a title.</p>
+ <p class="faint" id="covered-copy">Faint copy the intro covers.</p>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/preloader-enter-text.html b/tests/fixtures/overlays/preloader-enter-text.html
new file mode 100644
index 000000000..d095aa462
--- /dev/null
+++ b/tests/fixtures/overlays/preloader-enter-text.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Overlay hiding: a stuck preloader that mentions entering</title>
+ <style>
+ /* A stuck preloader whose short message mentions entering ("Preparing
+ to enter the site") but offers no way through: no pointer cursor, no
+ onclick and no control. It is a loader, not a splash gate, so the URL
+ engine waits for it and then hides it. Pinned by
+ crates/browser/tests/overlay_hiding.rs. */
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ #preloader { width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 9999999; background: #fff; }
+ .sk-circle { width: 80px; height: 80px; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
+ border: 6px solid #0b5c63; border-right-color: transparent; border-radius: 50%; }
+ .faint { margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ </style>
+</head>
+<body>
+ <div id="preloader"><div class="sk-circle"></div><p style="position:absolute;top:60%;width:100%;text-align:center">Preparing to enter the site</p></div>
+ <h1>A page under a stuck preloader</h1>
+ <p class="faint" id="covered-copy">Faint copy the preloader covers.</p>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/splash.html b/tests/fixtures/overlays/splash.html
new file mode 100644
index 000000000..e82e8e0ea
--- /dev/null
+++ b/tests/fixtures/overlays/splash.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Overlay hiding: a click-to-enter splash</title>
+ <style>
+ * { box-sizing: border-box; }
+ body { font: 16px/1.5 system-ui, sans-serif; margin: 0; padding: 40px; color: #111; background: #fff; }
+ .faint { margin: 0; font-size: 14px; line-height: 28px; color: #aaaaaa; }
+ /* A noteforge.co-shaped splash (corpus run 1006): a fixed black layer
+ over the whole screen, cursor: pointer, its only text "Enter NoteForge",
+ no link or button, which stays until clicked. The URL engine hides it
+ (nothing is clicked) and scores the page under it. Pinned by
+ crates/browser/tests/overlay_hiding.rs. */
+ .splash { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: #000; color: #fff; cursor: pointer; }
+ </style>
+</head>
+<body>
+ <div class="splash" onclick="this.remove()"><span>Enter NoteForge &rarr;</span></div>
+ <h1>A page under a splash</h1>
+ <p class="body-copy" style="max-width: 640px;">This page has copy of its own under the layer: a product, its pricing, its support hours and a note on shipping. A visitor reads it once the layer in front of it is gone, and the scan should read it too. It runs long enough to be more than a title.</p>
+ <p class="faint" id="covered-copy">Faint copy the splash covers.</p>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/stay-curtain.html b/tests/fixtures/overlays/stay-curtain.html
new file mode 100644
index 000000000..09989a581
--- /dev/null
+++ b/tests/fixtures/overlays/stay-curtain.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a fixed curtain hero with an Enter link</title>
+ <!-- Content scrolls over the hero from 100vh, so nothing of the page is under it. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/overlay_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<section class="hero" style="position:fixed;inset:0;z-index:0;background:#141414;color:#3a3a3a;display:flex;flex-direction:column;align-items:center;justify-content:center;font:20px sans-serif"><p id="own" style="font-size:40px;margin:0;color:#3a3a3a">Atelier Nord</p><a href="#work" style="color:#3a3a3a;border:1px solid #3a3a3a;padding:10px 28px;margin-top:24px">Enter</a></section>
+<div style="position:relative;z-index:1;margin-top:100vh;background:#fff"><main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main></div>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/stay-intro-hero.html b/tests/fixtures/overlays/stay-intro-hero.html
new file mode 100644
index 000000000..ed5764316
--- /dev/null
+++ b/tests/fixtures/overlays/stay-intro-hero.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a fixed hero named intro</title>
+ <!-- A fixed section.intro hero that content scrolls over: not waited for, not hidden. Review probe from work/round12/harness-review.md, pinned by crates/browser/tests/overlay_hiding.rs. -->
+</head>
+<body style="margin:0;background:#fff">
+<section class="intro" style="position:fixed;inset:0;z-index:0;background:#1b1b1b;color:#444;display:grid;place-items:center;font:22px sans-serif"><div><p id="own" style="color:#444;font-size:48px;margin:0">Halden Studio</p><p style="color:#444">Architecture and interiors, Oslo. Scroll to see the work.</p></div></section>
+<div style="position:relative;z-index:1;margin-top:100vh;background:#fff"><main style="position:relative;max-width:720px;margin:0 auto;padding:120px 24px 24px;font:17px/1.6 Georgia,serif;color:#222;background:#fff"><h1>Weekly notes</h1><p>Our kitchen bakes every morning from five. This week we are trying a brown butter batch with sea salt and a rye flour shortbread. Orders placed before noon ship the same day; orders after noon ship the next morning. Thank you for reading and for supporting a small shop.</p><p>Pickup is at the side door on Elm Street. Bring your order number. We close early on Sundays.</p></main></div>
+</body>
+</html>
diff --git a/tests/fixtures/overlays/stay-landing.html b/tests/fixtures/overlays/stay-landing.html
new file mode 100644
index 000000000..06954c610
--- /dev/null
+++ b/tests/fixtures/overlays/stay-landing.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Stays: a one-screen site on a fixed layer</title>
+ <!-- The fixed layer is the whole site: it holds the h1 and the page has no text outside it. -->
+</head>
+<body style="margin:0;background:#000">
+<div class="stage" style="position:fixed;inset:0;background:#0d0d0d;color:#333;display:grid;place-items:center;font:20px sans-serif"><div style="text-align:center"><h1 id="own" style="color:#333;font-size:72px;margin:0">ORBITAL</h1><p style="color:#333">A listening room in Berlin</p><a href="/room" style="color:#333">Enter</a></div></div>
+</body>
+</html>