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 17112 - [Custom]: Specify behavior of <script> element when child of <element>
Summary: [Custom]: Specify behavior of <script> element when child of <element>
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 17103
  Show dependency treegraph
 
Reported: 2012-05-18 20:05 UTC by Dimitri Glazkov
Modified: 2012-08-24 23:38 UTC (History)
1 user (show)

See Also:


Attachments

Description Dimitri Glazkov 2012-05-18 20:05:58 UTC
The fact that <script> element behaves differently when it is a child of <element> is bothersome. What are the alternatives?
Comment 1 Dominic Cooney 2012-05-22 06:44:39 UTC
Templates have already made a decision on this:

<https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#definitions>

Namely that <script> is inert; so be it. If there is an applicable alternative it should be examined for use in the template case as well.
Comment 2 Dimitri Glazkov 2012-05-22 16:10:26 UTC
(In reply to comment #1)
> Templates have already made a decision on this:
> 
> <https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#definitions>
> 
> Namely that <script> is inert; so be it. If there is an applicable alternative
> it should be examined for use in the template case as well.

This is for when <script> is a child of <element>, not <template>. It is not inert, but is instead executed in a specially constructed scope.
Comment 3 Dominic Cooney 2012-05-23 04:58:21 UTC
Got it.

If you want to run the script in a different context, I don’t see how you get around having different semantics. For example you could do <element onmumble="f()"> and fire onmumble after the child script has run. But then that script is running in the typical window context to define f.
Comment 4 Dimitri Glazkov 2012-08-24 23:38:59 UTC
http://dvcs.w3.org/hg/webcomponents/rev/15fded36e9c9