Den 12. aug. 2018 20:06, skrev Jon Dufresne:
> Django started adopting HTML5 features since before 2.1. I found
> changes as early as 1.11. From the release notes:
>
> https://docs.djangoproject.com/en/dev/releases/1.11/#miscellaneous

Perhaps, but I have run my project on Django 2.0 without being affected
by it.

>
> > The checked and selected attribute rendered by form widgets now uses
> HTML5 boolean syntax rather than XHTML’s checked='checked' and
> selected='selected'.
>
> FWIW, I prefer the concise syntax of HTML5 over XHTML and seems to be
> the de facto preferred style across much of the web. Style guides such
> as Google's recommend it. From
> https://google.github.io/styleguide/htmlcssguide.html#HTML:

HTML5 is not a replacement for XHTML as a XML serialization. In XML
empty attributes are not allowed, so the value has to be something (even
if just en empty string). In place of using true/false the standard says
that is must be either the same as the attribute name or an empty string
(for XHTML5). This is what we are stuck with for XML serialization of HTML5.

I think a framework should rate compatibility over conciseness. And
adding a value to a boolean attribute I think is a very minor hassle. In
our own application code we are free to choose.

>
> > Document Type
> >
> > Use HTML5.
> >
> > HTML5 (HTML syntax) is preferred for all HTML documents: <!DOCTYPE
> html>.
> >
> > (It’s recommended to use HTML, as text/html. Do not use XHTML.
> XHTML, as application/xhtml+xml, lacks both browser and infrastructure
> support and offers less room for optimization than HTML.)
> >
> > Although fine with HTML, do not close void elements, i.e. write
> <br>, not <br />.

I will say that this time is the best time ever to serve pages with
application/xhtml+xml, because all browsers supports it. IE was the road
blocker for year, but since IE9 it supports it as well. The points about
infrastructure and optimization are so vague I can hardly guess what the
writer thought about.

Se a list of the default value of the Accept header for various browsers
from Mozilla:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values

All except IE8 supports application/xhtml+xml.

Regards

-- 
Nils Fredrik Gjerull
-----------------------------
"Ministry of Eternal Affairs"
Computer Department
( Not an official title :) )


-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/79fc9df3-6205-5c84-41cb-82e0b0c6fe59%40gjerull.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to