Bug 105617 - [Shadow DOM]: Some named elements in ShadowTree visible on nesting document level
Summary: [Shadow DOM]: Some named elements in ShadowTree visible on nesting document l...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Takashi Sakamoto
URL:
Keywords:
Depends on:
Blocks: 63606 103230
  Show dependency treegraph
 
Reported: 2012-12-20 22:49 PST by Sergey G. Grekhov
Modified: 2013-01-05 12:13 PST (History)
6 users (show)

See Also:


Attachments
Patch (14.46 KB, patch)
2012-12-24 20:35 PST, Takashi Sakamoto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey G. Grekhov 2012-12-20 22:49:39 PST
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.
Comment 1 Takashi Sakamoto 2012-12-24 20:35:25 PST
Created attachment 180697 [details]
Patch
Comment 2 WebKit Review Bot 2013-01-05 12:13:07 PST
Comment on attachment 180697 [details]
Patch

Clearing flags on attachment: 180697

Committed r138897: <http://trac.webkit.org/changeset/138897>
Comment 3 WebKit Review Bot 2013-01-05 12:13:10 PST
All reviewed patches have been landed.  Closing bug.