MDL-33365 core: Move JS output to body
authorAndrew Nicols <andrew@nicols.co.uk>
Fri, 24 Jul 2015 01:09:18 +0000 (09:09 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 18 Aug 2015 07:48:55 +0000 (15:48 +0800)
commit2300a312a4d42d29d5672a3230761805c7b14c7c
treeda0f254aced409b7f24a609ed8d9d4f74a89c64d
parentdda862abb57f656633f0736b858f7f048efd44bb
MDL-33365 core: Move JS output to body

It turns out that, after all these years, we've been doing it wrong.
The YUI Loader should be loaded at the top of the body, not in the head.

Having it in the head means that the body has not yet loaded, and we see
a number of minor issues for scripts which happen very early in the load
process. One of these is the creation of invalid HTML from the YUI loader
because it is not able to insert in the body as it has not yet been
created.

To be safe, we must move all JS to the same point (because of unknown
dependencies between them). These should be placed as early in the body as
possible.

We also change the way in which the legacy YUI css modules are loaded.
lib/outputrequirementslib.php