Add some simple HTML5 support to JDocument. #699
Conversation
Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11145 assertions. |
@@ -60,8 +60,14 @@ public function fetchHead(&$document) | |||
$tab = $document->_getTab(); | |||
$tagEnd = ' />'; | |||
$buffer = ''; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks.
great! |
@piotr-cz |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11145 assertions. |
@realityking I think @piotr-cz means that the type attribute is unnecessary for style, script and links when they are default values in HTML5.
|
I think it will be for P!12.x (need to release P!11.4 for now) |
Sure. We can back port it to the CMS if we want to later on. |
yes, I've had in mind exactly what bigbangireland gave example of, now since we have html5 switch (is it going to be set in plugin/ configuration.php/ somewhere else?). |
A detailed discussion on HTML5 is needed well before Joomla! 3.0. As @piotr-cz says JForm can not currently handle many new attributes. eg. "pattern" could be useful when used with a JS class. Greater thought is also needed in regards to microdata and handling tags (aside, section, nav, etc) on modules. |
Question: from where to switch the $html5 variable? For me it would make most sense to use bigbangireland > I've been thinking about exactly this for a while, I guess we could start a discussion on Platform group to share implementation experiences and thoughts (Sorry to write it here, but it's not possible to message you on GitHub). |
@piotr-cz there was a discussion on the ideas forum a few months back. goo.gl/g1md6 Something like this:
I've temporarily added my email address to my public profile. |
I don't really wanna go into a lengthy discussion about the CMS stuff here so just a couple of points: The way I see it the isHTML5() check is mainly for platform related stuff, including JForm. However we have to be careful that everything keeps working when isHTML5 returns false. So I'd like to take us the conservative approach. One things that we could due for starters is output the required attribute when isHTML5() returns true. I really don't see this used for components or modules. I think template overrides are way better here. Of course nothing stops an extension dev from using it in this way. If this gets committed I'll submit code for JApplicationSite and JApplicationAdmin that lets you set the value trough a parameter of the template. I originally had that code right in JDocument but it couples the platform to tightly to the CMS. The global configuration (JConfig) is a really poor place for it since you may have both HTML5 and XHTML templates (e.g. one admin one site or two different site templates) |
realityking > Thanks this explanation, I get it now. You are correct about not using JConfig. |
We (JoomlaWorks) run a quick check on core code to see how it could be possible for Joomla! to read a template param (e.g. html5) and decide whether it should convert its output. I'm afraid this is not possible as it seems components may have already executed and therefore we cannot have full control of the output. It's a lot easier to do this with a system plugin and it's what we're going for. Check the source code of this page to see the plugin in action: http://dev.joomlaworks.net/ The code is actually pretty small and conforms to this: http://dev.w3.org/html5/html4-differences/ |
* @var boolean | ||
* @since 11.1 | ||
*/ | ||
private $_html5 = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understood right, even private member vars should go without a leading underscore. see this comment. I think they are ugly ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way works for me, it should just be written down some place so we eventually get a consistent code style. (The good thing about private variables is however that we can rename them at will)
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1971 tests and 11146 assertions. |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1941 tests and 11081 assertions. |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1905 tests and 11045 assertions. |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1991 tests and 11149 assertions. |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1991 tests and 11151 assertions. |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1994 tests and 11169 assertions. |
Any news on this? |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 1994 tests and 11169 assertions. |
Build triggered by changes to the head. Unit testing complete. There were 0 failures and 0 errors from 2062 tests and 11351 assertions. |
Add some simple HTML5 support to JDocument.
Another split off #683.
After a discussion with Christophe I think this is to tightly couple to the CMS. This will do, we can do the template magic in JApplicationSite.