Bug 106857 - [Shadow DOM]: ShadowAware.shadowRoot is not implemented
Summary: [Shadow DOM]: ShadowAware.shadowRoot is not implemented
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 63606 103230
  Show dependency treegraph
 
Reported: 2013-01-14 19:30 PST by Aleksei Yu. Semenov
Modified: 2013-01-22 23:38 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksei Yu. Semenov 2013-01-14 19:30:16 PST
The Shadow DOM specification (http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html)
defines interface ShadowAware as:

10.2.1 ShadowAware Attributes

pseudo of type DOMString
    Represents the custom pseudo-element value, associated with the element.
    On getting, the attribute must return the current custom pseudo-element value or empty string if there is no custom pseudo-element associated with this element.
    On setting, these steps must be run:
    If the custom pseudo-element, associated with this element already exists, discard it
    If the new value is not null, create a new custom pseudo-element with element and the new value as its value.
shadowRoot of type ShadowRoot
    Represents the top shadow tree in the "as rendered" structure.
    On getting, the attribute must return the youngest tree that has the context object as its shadow host, or null if no such shadow tree is accesible.
    For HTML elements, the UA-provided shadow trees must not be accessible.

However, the following sample test shows, that attribute ShadowAware.shadowRoot always equal to undefined value.

<html>
<head>
<script>
function test(){
	var host = document.createElement('div');
    document.body.appendChild(host);
	document.write('host.shadowRoot: '+host.shadowRoot+' (should be null)<BR>');
    document.write('created shadow root<BR>');
	var shadowRoot = host.webkitCreateShadowRoot();
	document.write('host.shadowRoot: '+host.shadowRoot+' (should be '+shadowRoot+')<BR>');
}
</script>
</head>
<body onload='test()'>
</body>
<html>

Observed on Google Chrome version 26.0.1383.0 canary
Comment 1 Shinya Kawanaka 2013-01-14 21:19:34 PST
We're using prefixed version of API, so host.webkitShadowRoot should work.

http://jsfiddle.net/dXu4k/
Comment 2 Hajime Morrita 2013-01-22 23:38:49 PST
Closing - The property is there with a prefixed form.