[Webkit-unassigned] [Bug 103608] [Shadow DOM]: @host @-rule doesn't work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 29 03:24:13 PST 2012


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





--- Comment #2 from Sergey G. Grekhov <sgrekhov at unipro.ru>  2012-11-29 03:26:29 PST ---
Thank you for quick response. Updated example doesn't work anyway. See below

<html>
<head>
<script type="text/javascript">

function test() {
    var SR = window.ShadowRoot || window.WebKitShadowRoot;
    var d = document;

    var host = d.createElement('div');
    d.body.appendChild(host);

    //Older tree
    var s1 = new SR(host);
    var div1 = d.createElement('div');
    div1.innerHTML = '<span id="shd1">This is an old shadow tree</span>'; 
    s1.appendChild(div1);

    //Younger tree
    var s2 = new SR(host);
    var div1 = d.createElement('div');
    div1.innerHTML = '<span id="shd2">This is a young shadow tree</span>' + 
        '<shadow><span id="shd3">This is the shadow tree fallback content</span></shadow>'; 
    s2.appendChild(div1);

    var style = d.createElement('style');
    style.innerHTML = '' + 
            '@host {' +
                'div{display:none;}' +
            '}'; 
    s2.appendChild(style);    
}
</script>
</head>
<body onload="test()">

</body>
</html>

After running of this test both of the trees are shown

-- 
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