Re: Proposal: Use HTML5 boolean attribute for checked on checkbox/radio inputs

2016-07-25 Thread Jon Dufresne
> I was wondering if it causes any HTML validation problems for other
doctypes?

True. A strict validator for XHTML will flag HTML5 syntax as an error. It
isn't a part of the XHTML spec. From my testing it seems like modern
browsers can handle this, but you're right, validators will catch it.

> If so, we might document that Django's default HTML rendering targets the
HTML5 doctype.

Makes sense to me. I've updated PR with additional documentation that
mentions this.

Cheers,
Jon

-- 
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/CADhq2b5UsjaAKQhe%2Bn0eYabCuBPTG-72RvYEHz1dC7oZgefvGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: Use HTML5 boolean attribute for checked on checkbox/radio inputs

2016-07-25 Thread Tim Graham
I was wondering if it causes any HTML validation problems for other 
doctypes? If so, we might document that Django's default HTML rendering 
targets the HTML5 doctype.

On Saturday, July 23, 2016 at 4:21:22 AM UTC-4, Florian Apolloner wrote:
>
> This should be perfectly fine -- I guess just nobody got around to do it 
> yet. The main issue with the HTML5 stuff is around date where it is 
> not clearly specified (or was last time I looked) what the UA should send 
> and how to handle that in browsers not supporting HTML5 yet (ie sending iso 
> date/time is not so nice when you want to display it localized). The 
> required attribute was also problematic in the sense that now hidden 
> (unused) forms with required would prevent the page from validating etc… So 
> any change like yours currently, which does not introduce such issues 
> should be no problem.
>
> Cheers,
> Florian
>
> On Friday, July 22, 2016 at 11:30:58 PM UTC+2, Jon Dufresne wrote:
>>
>> Hi,
>>
>> I would like to propose that Django renders the "checked" attribute of 
>> checkbox and radio inputs using the HTML5 boolean style attributes.
>>
>> Django has supported HTML5 boolean attributes since 1.8 [0]. It has used 
>> them internally for the "disabled" attribute since 1.9 [1] and the 
>> "required" attribute starting with 1.10 [2]. So there is some precedent to 
>> using the HTML5 style. I find the newer style cleaner and more in line with 
>> modern conventions.
>>
>> I have created a ticket [3] with this proposal as well as a PR [4].
>>
>> One concern raised in the ticket is backwards compatibility with 
>> non-HTML5 doctypes. I'm not aware of any such issues with modern browsers. 
>> I have tested older doctypes on Firefox and Chrome, both accept the HTML5 
>> boolean style with HTML4 and XHTML doctypes. Currently, I do not have 
>> access to IE, so I am unable to test those cases. If anyone is interested 
>> to test, there is a very simple test case in the ticket.
>>
>> Additionally, if there is an issue with older doctypes, presumably this 
>> issue already exists with the disabled and required attributes.
>>
>> Just reaching out for feedback, concerns, and comments.
>>
>> Thanks!
>>
>> Cheers,
>> Jon
>>
>>
>> [0] https://docs.djangoproject.com/en/dev/releases/1.8/#forms
>> [1] 
>> https://github.com/django/django/blob/stable/1.9.x/django/forms/boundfield.py#L88-L89
>> [2] 
>> https://github.com/django/django/blob/stable/1.10.x/django/forms/boundfield.py#L88-L89
>> [3] Ticket: https://code.djangoproject.com/ticket/26928
>> [4] PR: https://github.com/django/django/pull/6961
>>
>>

-- 
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/fbf8f4be-d7cf-495d-9754-dc5c0e54f962%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: Use HTML5 boolean attribute for checked on checkbox/radio inputs

2016-07-23 Thread Florian Apolloner
This should be perfectly fine -- I guess just nobody got around to do it 
yet. The main issue with the HTML5 stuff is around date where it is 
not clearly specified (or was last time I looked) what the UA should send 
and how to handle that in browsers not supporting HTML5 yet (ie sending iso 
date/time is not so nice when you want to display it localized). The 
required attribute was also problematic in the sense that now hidden 
(unused) forms with required would prevent the page from validating etc… So 
any change like yours currently, which does not introduce such issues 
should be no problem.

Cheers,
Florian

On Friday, July 22, 2016 at 11:30:58 PM UTC+2, Jon Dufresne wrote:
>
> Hi,
>
> I would like to propose that Django renders the "checked" attribute of 
> checkbox and radio inputs using the HTML5 boolean style attributes.
>
> Django has supported HTML5 boolean attributes since 1.8 [0]. It has used 
> them internally for the "disabled" attribute since 1.9 [1] and the 
> "required" attribute starting with 1.10 [2]. So there is some precedent to 
> using the HTML5 style. I find the newer style cleaner and more in line with 
> modern conventions.
>
> I have created a ticket [3] with this proposal as well as a PR [4].
>
> One concern raised in the ticket is backwards compatibility with non-HTML5 
> doctypes. I'm not aware of any such issues with modern browsers. I have 
> tested older doctypes on Firefox and Chrome, both accept the HTML5 boolean 
> style with HTML4 and XHTML doctypes. Currently, I do not have access to IE, 
> so I am unable to test those cases. If anyone is interested to test, there 
> is a very simple test case in the ticket.
>
> Additionally, if there is an issue with older doctypes, presumably this 
> issue already exists with the disabled and required attributes.
>
> Just reaching out for feedback, concerns, and comments.
>
> Thanks!
>
> Cheers,
> Jon
>
>
> [0] https://docs.djangoproject.com/en/dev/releases/1.8/#forms
> [1] 
> https://github.com/django/django/blob/stable/1.9.x/django/forms/boundfield.py#L88-L89
> [2] 
> https://github.com/django/django/blob/stable/1.10.x/django/forms/boundfield.py#L88-L89
> [3] Ticket: https://code.djangoproject.com/ticket/26928
> [4] PR: https://github.com/django/django/pull/6961
>
>

-- 
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/aa4e3252-58f8-46a9-be6a-487bbdb1a0bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Proposal: Use HTML5 boolean attribute for checked on checkbox/radio inputs

2016-07-23 Thread Claude Paroz
Le vendredi 22 juillet 2016 23:30:58 UTC+2, Jon Dufresne a écrit :
>
> Hi,
>
> I would like to propose that Django renders the "checked" attribute of 
> checkbox and radio inputs using the HTML5 boolean style attributes.
>
(...)

I'm definitely +1 with this change.
Hopefully, 1.11 should come with template-based widget rendering, so as 
people who need it can customize the default output.

Claude

-- 
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/cc80bcde-85e5-4a78-b160-19f6195e3192%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Proposal: Use HTML5 boolean attribute for checked on checkbox/radio inputs

2016-07-22 Thread Jon Dufresne
Hi,

I would like to propose that Django renders the "checked" attribute of
checkbox and radio inputs using the HTML5 boolean style attributes.

Django has supported HTML5 boolean attributes since 1.8 [0]. It has used
them internally for the "disabled" attribute since 1.9 [1] and the
"required" attribute starting with 1.10 [2]. So there is some precedent to
using the HTML5 style. I find the newer style cleaner and more in line with
modern conventions.

I have created a ticket [3] with this proposal as well as a PR [4].

One concern raised in the ticket is backwards compatibility with non-HTML5
doctypes. I'm not aware of any such issues with modern browsers. I have
tested older doctypes on Firefox and Chrome, both accept the HTML5 boolean
style with HTML4 and XHTML doctypes. Currently, I do not have access to IE,
so I am unable to test those cases. If anyone is interested to test, there
is a very simple test case in the ticket.

Additionally, if there is an issue with older doctypes, presumably this
issue already exists with the disabled and required attributes.

Just reaching out for feedback, concerns, and comments.

Thanks!

Cheers,
Jon


[0] https://docs.djangoproject.com/en/dev/releases/1.8/#forms
[1]
https://github.com/django/django/blob/stable/1.9.x/django/forms/boundfield.py#L88-L89
[2]
https://github.com/django/django/blob/stable/1.10.x/django/forms/boundfield.py#L88-L89
[3] Ticket: https://code.djangoproject.com/ticket/26928
[4] PR: https://github.com/django/django/pull/6961

-- 
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/CADhq2b6WBJfd0_XWPXPbApdG7KkYAYGNK69joOF3uGgcEvqCFg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.