proposal approach + doctype setting for smooth html5 migration #447

Closed
Guite opened this Issue Aug 16, 2012 · 12 comments

Comments

Projects
None yet
4 participants
Owner

Guite commented Aug 16, 2012

When using some html5 or css3 features usually the following pattern is applied.

  1. Output the new version per default
  2. Check in JavaScript if the feature is supported by the user agent (using Modernizr or manual test code)
  3. If yes: fine
  4. If no: apply a fallback solution (e.g. some jQuery UI components or other plugins, conditional comments, other)

To support that conveniently in the core (where applicable) I propose the following approach in order to encapsulate the decision code in the according components. For example I use a date picker here.

  1. Check if the html5 doctype is used in the current theme
  2. If yes: output html5 date input + JS feature detection + jQuery UI datepicker usage when fallback is needed
  3. If no: output text input + jQuery UI datepicker usage

Additional remarks:

  1. It is recommended to add Modernizr to the core
  2. We would need some theme setting so that we can reliably detect (on the server side) if html5 is used. We had a flag for xhtml support some time ago - to have something more usable I would prefer a doctype setting accepting a documented list of values
  3. It is obvious that we can not only introduce html5, but add modern jQuery components at the same time. Both benefits go hand in hand, and consistency will be improved. Later when html5 is 99% supported we can remove the fallbacks as they become unneeded.
Member

jusuff commented Aug 16, 2012

+1

Owner

Guite commented Aug 16, 2012

Forgotten remark:
4. All stuff from the example would be encapsulated within the DateInput form plugin. It becomes interesting when it comes to combine this with the Symfony2 form framework adaption :-)

Contributor

phaidon commented Aug 16, 2012

Maybe it makes sense to include the Bootstrap integration in this thinkings.

Member

jusuff commented Dec 13, 2012

What about implementing this in 1.4 milestone?
@Drak - what do you think?

@ghost

ghost commented Dec 13, 2012

No objections. Are you volunteering?

Member

jusuff commented Dec 13, 2012

I may try when I will finish current task. The most important thing for me is switch to html5 doctype.

@ghost

ghost commented Dec 13, 2012

Switching to 1.4.0 then - anyone can pick this up of course....

Member

jusuff commented Dec 13, 2012

Great! Thanks

@ghost

ghost commented Jan 27, 2013

The doctype has been switched in 1.4 (when the PR is merged that is)

Owner

Guite commented Jan 27, 2013

We can't simply switch the doctype centrally. It is controlled by a theme. Also we shouldn't enforce a certain doctype to the users, but let them control it freely fitting to the project requirements.

@ghost

ghost commented Jan 27, 2013

Yes, and the examples in the core have been switched.

@ghost

ghost commented Sep 8, 2013

There is no longer any reason for doctrypes not to be html5. Modernizr is in the core.

This was referenced Sep 29, 2013

@ghost ghost closed this Nov 1, 2013

@craigh craigh modified the milestones: 1.4.0, 2.0.0 Feb 16, 2015

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment