Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#14984 closed (fixed)

ClearableFileInput generates invalid XHTML

Reported by: lukeplant Owned by: elbarto
Component: Forms Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The 'target' attribute of anchors does not exist in XHTML Strict, making admin pages with the ClearableFileInput widget produce invalid XHTML.

I do not propose fixing this yet, because the 'target' attribute is valid in HTML5, and its usefulness outweighs the fact that it is technically invalid XHTML. I'm just noting it, mainly as a reason we should think about moving to HTML5.

Attachments (1)

patch.diff (620 bytes) - added by elbarto 5 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 5 years ago by gabrielhurley

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

While it's true that the target attribute is valid HTML5, that's not the standard we've been complying to thus far. Looking at the source, it doesn't look like the target="_blank" is providing any critical functionality, merely an added nicety. I'm not personally affected by 100% XHTML4 compliance, but I know that some people are. As such it seems to me that it ought to be removed on principle until Django officially support either HTML5 or configurable doctype output options.

I don't feel strongly, however. Marking as accepted.

comment:2 Changed 5 years ago by elbarto

  • Owner changed from nobody to elbarto

Changed 5 years ago by elbarto

comment:3 Changed 5 years ago by elbarto

  • Has patch set

comment:4 Changed 5 years ago by jezdez

  • milestone set to 1.3
  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

In [15426]:

Fixed #14984 -- Ensure that ClearableFileInput produces XHTML Strict output. Thanks to Luke for the report.

comment:6 Changed 4 years ago by ramiro

In [15432]:

Modified wrong expected ClearableFileInput rendering output in a couple of additional tests after fix introduced in [15426]. Refs #14984.

comment:7 Changed 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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