Issue #55: Testing click rules that target elements inside Shadow DOM using host_selector and inner_selector
What's being tested: Shadow DOM click rules with host_selector + inner_selector
Expected result: Clicks on elements matching a Shadow DOM rule should emit ct: 'rule' and the correct rule ID
Configured rules:
{
"clicks": {
"rules": [
{ "id": "shadow-widget-btn", "host_selector": "shadow-widget", "inner_selector": "button.action-btn" },
{ "id": "shadow-card-link", "host_selector": "shadow-card", "inner_selector": "a.card-link" },
{ "id": "shadow-cta-primary", "host_selector": ".shadow-cta-host", "inner_selector": "button[data-cta='primary']" },
{ "id": "nested-shadow-btn", "host_selector": "shadow-nested-outer", "inner_selector": "button.nested-btn" },
{ "id": "standard-rule-btn", "selector": "#standard-rule-target" } // Non-shadow comparison
]
}
}
{ id: "shadow-widget-btn", host_selector: "shadow-widget", inner_selector: "button.action-btn" }
ct: 'rule', rule: 'shadow-widget-btn', shadow: true
{ id: "shadow-card-link", host_selector: "shadow-card", inner_selector: "a.card-link" }
ct: 'rule', rule: 'shadow-card-link', shadow: true
{ id: "shadow-cta-primary", host_selector: ".shadow-cta-host", inner_selector: "button[data-cta='primary']" }
ct: 'rule', rule: 'shadow-cta-primary', shadow: true
ct: 'button', shadow: true (NO rule match - falls back to button type)
{ id: "standard-rule-btn", selector: "#standard-rule-target" }
ct: 'rule', rule: 'standard-rule-btn' (no shadow flag)
shadowRoot is not accessible in closed mode.
Click event will be detected but rule cannot match inner elements.
F12)_ll.debug(true)ct: 'rule' and correct rule ID in events