[Webkit-unassigned] [Bug 103479] New: [Shadow DOM]: Event that must be stopped at Shadow boundary is not stopped if fired from DOM node distributed into insertion point

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 27 21:45:58 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=103479

           Summary: [Shadow DOM]: Event that must be stopped at Shadow
                    boundary is not stopped if fired from DOM node
                    distributed into insertion point
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: sgrekhov at unipro.ru


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

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list