Opened 8 years ago

Closed 8 years ago

#26928 closed Cleanup/optimization (fixed)

Change checkbox/radio checked attribute to HTML5 boolean style

Reported by: Jon Dufresne Owned by: nobody
Component: Forms Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

As Django supports HTML5 boolean attributes and they are used for existing form attributes internally, I think the checkbox/radio checked attribute should be converted to use HTML5 boolean style as well.

Change History (7)

comment:1 by Jon Dufresne, 8 years ago

Has patch: set

comment:2 by Tim Graham, 8 years ago

required and disabled were added recently so I guess backwards-compatibility wasn't much of a concern. Are there any backwards-compatibility concerns for projects not using an HTML5 doctype?

comment:3 by Jon Dufresne, 8 years ago

Are there any backwards-compatibility concerns for projects not using an HTML5 doctype?

I'm not aware of any for modern browsers. Just now, I tested the following HTML document:

<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <p>
      <input type="checkbox" checked>
    </p>
  </body>
</html>

Against the doctypes listed on w3.org.

All of these doctypes worked with recent versions of Firefox and Chrome -- they rendered the checkbox as checked on page reload. I currently do not have easy access to IE for testing.

If you think it would help, I could add a blurb to the "Backwards incompatible changes" section of the release notes.

comment:4 by Tim Graham, 8 years ago

I'd like to ask on the DevelopersMailingList if anyone has concerns about this change.

comment:6 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

comment:7 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In 50e299d:

Fixed #26928 -- Changed forms' checked attribute to HTML5 boolean style.

Note: See TracTickets for help on using tickets.
Back to Top