Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set document.currentScript for <script type="module"> #997

Closed
domenic opened this issue Apr 5, 2016 · 4 comments
Closed

Don't set document.currentScript for <script type="module"> #997

domenic opened this issue Apr 5, 2016 · 4 comments

Comments

@domenic
Copy link
Member

domenic commented Apr 5, 2016

Per discussions in web components F2F, we don't like this API anymore and want to consider a better one for new stuff like modules and scripts-inside-shadow-DOM.

/cc @jonco3 @ajklein @Constellation @DigiTec

@smaug----
Copy link

How should the relevant events work in this case. For shadow DOM we can mark the events scoped, but that doesn't really affect to the behavior in light DOM.

@domenic
Copy link
Member Author

domenic commented Apr 5, 2016

beforescriptexecute and afterscriptexecute, you mean? They seem somewhat unrelated to me... modules would still have them.

@smaug----
Copy link

Don't know why those are unrelated, but anyhow, something to keep in mind at least.

@annevk
Copy link
Member

annevk commented Apr 6, 2016

@domenic I think we should not dispatch those either. I think the idea with those events is that you can then grab the script (using document.currentScript and manipulate it before it gets executed. The events are also controversial per #943 so only Gecko would implement support for them presumably...

domenic added a commit that referenced this issue Apr 11, 2016
They no longer set document.currentScript, or fire beforescriptexecute
and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to
document.currentScript, and #943 for more discussion of the events.
domenic added a commit that referenced this issue Apr 13, 2016
They set document.currentScript to null, and no longer fire
beforescriptexecute and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to
document.currentScript, and #943 for more discussion of the events.
domenic added a commit that referenced this issue Apr 14, 2016
They set document.currentScript to null, and no longer fire
beforescriptexecute and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to
document.currentScript, and #943 for more discussion of the events.
annevk pushed a commit that referenced this issue Apr 15, 2016
Make module scripts modify less global script state. They set document.currentScript to null, and no longer fire beforescriptexecute and afterscriptexecute events.

Closes #997. See #1013 for a future alternative to document.currentScript, and #943 for more discussion of the events.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants