Opened 2 years ago

Closed 2 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: master
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 Changed 2 years ago by Jon Dufresne

Has patch: set

comment:2 Changed 2 years ago by Tim Graham

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 Changed 2 years ago by Jon Dufresne

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 Changed 2 years ago by Tim Graham

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

comment:6 Changed 2 years ago by Tim Graham

Triage Stage: UnreviewedAccepted

comment:7 Changed 2 years ago by Tim Graham <timograham@…>

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