RESOLVED WONTFIX 103479
[Shadow DOM]: Event that must be stopped at Shadow boundary is not stopped if fired from DOM node distributed into insertion point
https://bugs.webkit.org/show_bug.cgi?id=103479
Summary [Shadow DOM]: Event that must be stopped at Shadow boundary is not stopped if...
Sergey G. Grekhov
Reported 2012-11-27 21:48:12 PST
According Shadow DOM specification (https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#events-that-are-always-stopped) Abort event should always be stopped at the nearest Shadow boundary. It works, but if the event is fired from the DOM node distributed into insertion point then it is not stopped. Run the following example: <html> <head> <script type="text/javascript"> function test() { var SR = window.ShadowRoot || window.WebKitShadowRoot; var d = document; var host = d.createElement('div'); host.setAttribute('id', 'host'); d.body.appendChild(host); var inp1 = d.createElement('input'); inp1.setAttribute('id', 'inp1'); inp1.setAttribute('type', 'checkbox'); inp1.setAttribute('class', 'clazz1'); host.appendChild(inp1); var inp2 = d.createElement('input'); inp2.setAttribute('id', 'inp2'); inp2.setAttribute('type', 'checkbox'); inp2.setAttribute('class', 'clazz2'); host.appendChild(inp2); var inp3 = d.createElement('input'); inp3.setAttribute('id', 'inp3'); inp3.setAttribute('type', 'checkbox'); inp3.setAttribute('class', 'clazz1'); host.appendChild(inp3); //Shadow root to play with var s = new SR(host); var shadowDiv = document.createElement('div'); shadowDiv.innerHTML = '<content select=".clazz1"></content>'; s.appendChild(shadowDiv); d.body.addEventListener('abort', function(event) { alert('Abort event should always be stopped at Shadow boundary!'); }, false); var event = d.createEvent('UIEvent'); event.initUIEvent ('abort', true, false); inp1.dispatchEvent(event); } </script> </head> <body onload="test()"> </body> </html> This example shows that the event is not stopped on the shadow boundary
Attachments
Hayato Ito
Comment 1 2012-12-06 03:32:20 PST
This is an expected behavior. Event should be stopped at the nearest shadow boundary, but for distributed nodes, an event should be dispatched in the outer tree as normal. Attaching a shadow root should not change the behavior of event dispatching in the outer tree. I think you might want to file a bug for the Shadow DOM spec if something is unclear.
Note You need to log in before you can comment on or make changes to this bug.