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 7792 - async on inline script is gratuitously backwards-incompatible, should be ignored
Summary: async on inline script is gratuitously backwards-incompatible, should be ignored
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
Keywords: NE
Depends on:
Reported: 2009-10-02 09:08 UTC by Henri Sivonen
Modified: 2010-10-04 13:58 UTC (History)
6 users (show)

See Also:


Description Henri Sivonen 2009-10-02 09:08:45 UTC
Since inline scripts are immediately available, it seems that the only effect the async attribute has on them is that document.write() blows away the document instead of writing to the stream.

While this would allow an optimization in speculative parsing, it seems dangerous to introduce a situation where people developing on an older browser could blow away the document without any other benefit than a timing optimization. Furthermore, if one wanted to deliberately promise not to use document.write() but one otherwise wanted the usual scripting semantics, it would be less confusing to have an attribute like "nodocumentwrite" which would make a parser with speculation capability not start a new speculation. (I'm not actually suggesting such an attribute here, because I don't have data about the perf effect of the potential optimization.)

Thus, even if a minor opportunity for optimization is lost, it would seem prudent to ignore async on inline scripts like defer is ignored on inline scripts.
Comment 1 contributor 2009-10-09 04:36:33 UTC
Checked in as WHATWG revision r4098.
Check-in comment: Dramatically simplify <script defer> and <script async> handling.