This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22411 - [Shadow]: Specify the interaction with document.currentScript
Summary: [Shadow]: Specify the interaction with document.currentScript
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Hayato Ito
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 22715
  Show dependency treegraph
 
Reported: 2013-06-20 01:51 UTC by Yuta Kitamura
Modified: 2014-05-29 06:46 UTC (History)
1 user (show)

See Also:


Attachments

Description Yuta Kitamura 2013-06-20 01:51:03 UTC
Section 4.1 reads:
> The nodes and named elements are not accessible using shadow host's
> document DOM tree accessors [...]

Document DOM tree accessors include document.currentScript
(cf. <http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-tree-accessors>).

When a script element in a shadow tree is running, what should
document.currentScript return? From what I read the current specification,
a script element in a shadow tree should not be exposed to
document.currentScript, but it is unclear what should be returned instead.

It might be fine to return a script element in a shadow tree, because it can
only be obtained from the script inside the shadow tree (i.e. scripts on
the owner document will not be able to obtain the script element in the shadow
tree), if I understand correctly.
Comment 1 Hayato Ito 2014-05-29 06:46:14 UTC
We no longer use the phrase 'DOM tree accessors' in the spec.
Let me close this.

I think the current spec implies that document.currentScript should not return a script in shadow trees.