pour-engine 1.35.0 → 1.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,6 @@
6
6
  export default {
7
7
  engine: {
8
8
  name: 'pour engine',
9
- version: '1.35.0',
9
+ version: '1.35.1',
10
10
  },
11
11
  };
@@ -903,7 +903,36 @@ export function paintedBackdrop(element) {
903
903
  overlays.push(own);
904
904
  }
905
905
  if (start === -1) return 'unresolved';
906
+ // Ancestors the hit-test cannot see. pointer-events: none is inherited
907
+ // and takes an element (and, unless they opt back in, its descendants)
908
+ // out of every hit-test stack, but it paints exactly as before. A white
909
+ // title inside a fixed black header with pointer-events: none, the title
910
+ // itself set back to auto, hit-tests as [title, page, body]: the black
911
+ // layer is skipped and the walk below composites the page colour under
912
+ // the glyphs (business.hsbc.com, 2026-08-27, asserted 1.10:1 white on
913
+ // #f3f3f3 under a black bar). So the painting ancestors missing from the
914
+ // stack are folded back in, each at its place in paint order: an
915
+ // ancestor paints beneath all of its descendants, so its turn comes when
916
+ // the next stack layer is no longer inside it. Only ancestors whose box
917
+ // holds the sample point count; a parent the text has been positioned
918
+ // out of paints nowhere under it and is rightly absent.
919
+ const missing = [];
920
+ const inStack = new Set(stack);
921
+ for (let a = element.parentElement ?? element.getRootNode()?.host; a && a.nodeType === 1; a = a.parentElement ?? a.getRootNode()?.host) {
922
+ if (inStack.has(a)) continue;
923
+ const box = a.getBoundingClientRect();
924
+ if (point.x < box.left || point.x >= box.right || point.y < box.top || point.y >= box.bottom) continue;
925
+ const st = getComputedStyle(a);
926
+ const c = parseColor(st.backgroundColor);
927
+ if ((c && c.a > 0) || (st.backgroundImage !== 'none' && !paintsNothing(st.backgroundImage))) missing.push(a);
928
+ }
929
+ const layers = [];
906
930
  for (const layer of stack.slice(start + 1)) {
931
+ while (missing.length && !missing[0].contains(layer)) layers.push(missing.shift());
932
+ layers.push(layer);
933
+ }
934
+ layers.push(...missing);
935
+ for (const layer of layers) {
907
936
  // Replaced elements paint their content, not a background — a photo or
908
937
  // video in the stack is an image backdrop whatever its styles say.
909
938
  if (/^(img|video|canvas|svg|picture|object|embed|iframe)$/i.test(layer.tagName)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pour-engine",
3
- "version": "1.35.0",
3
+ "version": "1.35.1",
4
4
  "description": "Accessibility (WCAG 2.2) audit engine written from the W3C specifications — runs entirely in the browser, no dependencies.",
5
5
  "type": "module",
6
6
  "main": "engine/index.js",