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 9361 - script element should be allowed essentially anywhere
Summary: script element should be allowed essentially anywhere
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://dev.w3.org/html5/spec/Overview...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-28 21:29 UTC by Maciej Stachowiak
Modified: 2010-10-04 14:29 UTC (History)
5 users (show)

See Also:


Attachments

Description Maciej Stachowiak 2010-03-28 21:29:50 UTC
The script element is allowed most places; wherever metadata content or phrasing content is expected. However, it is disallowed in some highly structured elements that only allow specific children. 

In the wild, it appears there are at least cases of script being used inside <ul>:

http://www.w3.org/html/wg/wiki/index.php?title=HTML5_Authoring_Conformance_Study

It would be useful to allow <script> inside at least <ul>, <ol>, <dl>, <table> and other table structure elements, <video>, <audio> etc. The only place where it should probably be disallowed is in elements that parse their contents as raw text (<title>, <script>, <style>, etc).
Comment 1 Maciej Stachowiak 2010-03-28 21:31:52 UTC
Other plausible exceptions include any place where the script would be reparented by the parser if found there.
Comment 2 Ian 'Hixie' Hickson 2010-04-04 09:17:27 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: Insofar as one can rely on one's input being conforming, I think it is very useful to be able to rely on one's input having <ul> elements that contain only <li>s. It makes the processing much saner — no need to remember to skip <script> (and then <style>, and then <meta>, and then all the other things we'd end up allowing there) when processing a list. It's not like it's a hardship to move the <script> outside the <ul>. The only plausible reason to have it there is to use document.write(), and frankly (a) that should be discouraged anyway and (b) one can easily just write the <ul> also. The same argument applies analogously to the other cases you listed.