[Webkit-unassigned] [Bug 105617] New: [Shadow DOM]: Some named elements in ShadowTree visible on nesting document level

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 20 22:47:25 PST 2012


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

           Summary: [Shadow DOM]: Some named elements in ShadowTree
                    visible on nesting document level
           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#upper-boundary-encapsulation) "The nodes and named elements are not accessible using shadow host's document DOM tree accessors or with Window object named properties". But in fact some named elements are accessible (Chrome 26.0.1366.0 canary). Test:

<html>
<head>
<script type="text/javascript">
function test() {
    var d = document;
    var div = d.createElement('div');
    d.body.appendChild(div);
    var s = div.webkitCreateShadowRoot();

    //Window named properties
    var namedElements = ['a', 'applet', 'area', 'embed', 'form', 'frame',
        'frameset', 'iframe','img', 'object'];

    namedElements.forEach(function (tagName) {
        var element = d.createElement(tagName);
        element.name = 'named_' + tagName;
        d.body.appendChild(element);

        s.appendChild(element);

        if (element.name in d) {
            console.log( element.name + ' accessible');
        } else {
            console.log( element.name + ' inaccessible');
        }
    });
 }
</script>
</head>
<body onload="test()">
</body>
</html>


Run this test and observe Chrome console. Result: applet, embed, form, iframe, img and object are visible on the document level.

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