[whatwg] Questions about script attributes in HTML5

Henri Sivonen hsivonen at iki.fi
Thu Jul 29 05:15:28 PDT 2010


Aryeh Gregor wrote:
> > Quote:
> > "The defer and async attributes must not be specified if the src
> > attribute
> > is not present."
> > Do it mean "if the src attribute is not present, the defer and async
> > attributes can be not used" ? (English is not my native language, :)
> > )
> 
> Yes. I don't know why defer isn't allowed here -- maybe someone else
> knows the answer.

Defer isn't allowed here, because it gets ignored. It gets ignored, because existing content calls document.write from internal scripts that specify defer. Deferring such scripts would lead to badness, obviously. Also, specifying defer or async on internal scripts makes no sense, since the whole point is managing the concurrency of network fetches, and you don't new separate fetches for internal scripts.

-- 
Henri Sivonen
hsivonen at iki.fi
http://hsivonen.iki.fi/



More information about the whatwg mailing list