Joomla3-Admin-template / joomla-cms

Home of the Joomla! Content Management System
http://joomla.org
GNU General Public License v2.0
53 stars 11 forks source link

Type attributes are not required in html(5) #114

Open nternetinspired opened 12 years ago

nternetinspired commented 12 years ago

Whilst not strictly wrong, type attributes on assets such as .js and .css, as included here: https://github.com/Joomla3-Admin-template/joomla-cms/blob/template9/libraries/joomla/document/html/renderer/head.php#L121 are simply not required any more.

Browsers are smart enough now to know that file.js is a Javascript file without being told that. Moreover, they check that is the case; http://dev.w3.org/html5/spec/single-page.html#the-link-element

I see there is already code to determin doctype if ($document->isHtml5()) in the same file, so this would seem (I am not a coder!) to be a fairly simple proposition to remove these for html documents.

See: http://html5doctor.com/avoiding-common-html5-mistakes/ for a human-readable explanation of the html5 spec!