pour-engine 1.22.0 → 1.23.0
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.
package/config/project.config.js
CHANGED
|
@@ -38,7 +38,19 @@ export default {
|
|
|
38
38
|
?? IMPLICIT_CONTAINER[owner.tagName.toLowerCase()]);
|
|
39
39
|
if (ownerRole && containers.includes(ownerRole)) return { status: 'pass' };
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
// FLAT-TREE ancestry, not light-DOM ancestry: assistive technology sees
|
|
42
|
+
// the composed tree, so a slotted role="listitem" whose role="list"
|
|
43
|
+
// container lives inside the host component's shadow root IS inside a
|
|
44
|
+
// list (Adobe Spectrum's sidenav is exactly this — a light-DOM walk was
|
|
45
|
+
// 11 false asserts on one page). An element assigned to a slot continues
|
|
46
|
+
// through the slot's shadow-side ancestors; an element at a shadow root's
|
|
47
|
+
// top continues through the host.
|
|
48
|
+
const flatParent = (node) => node.assignedSlot
|
|
49
|
+
?? node.parentElement
|
|
50
|
+
?? (node.getRootNode() instanceof ShadowRoot ? node.getRootNode().host : null);
|
|
51
|
+
for (let parent = flatParent(element); parent; parent = flatParent(parent)) {
|
|
52
|
+
// A <slot> is rendering plumbing with no tree presence of its own.
|
|
53
|
+
if (parent.tagName === 'SLOT' && !parent.hasAttribute('role')) continue;
|
|
42
54
|
const parentRole =
|
|
43
55
|
parent.getAttribute('role')?.trim().split(/\s+/)[0]?.toLowerCase() ??
|
|
44
56
|
IMPLICIT_CONTAINER[parent.tagName.toLowerCase()];
|
package/package.json
CHANGED