Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8440 closed (invalid)

Change forms default auto_id='id-%s'

Reported by: cdleary@… Owned by: cdleary
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Hey all,

I don't think that the default auto_id for form fields is compatible with CSS1, since it starts with "id_". A la

unicode		\\[0-9a-f]{1,4}
latin1		[¡-ÿ]
escape		{unicode}|\\[ -~¡-ÿ]
stringchar	{escape}|{latin1}|[ !#$%&(-~]
nmstrt		[a-z]|{latin1}|{escape}
nmchar		[-a-z0-9]|{latin1}|{escape}
ident		{nmstrt}{nmchar}*
name		{nmchar}+

I believe it's a real simple patch (attached), but I haven't tested it rigorously.



Attachments (1)

auto_id.diff (2.1 KB) - added by cdleary@… 10 years ago.
Simple proposal auto_id patch.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by cdleary@…

Attachment: auto_id.diff added

Simple proposal auto_id patch.

comment:1 Changed 10 years ago by Daniel Pope <dan@…>

That's an error in CSS1. It's fixed in CSS 2.1. The HTML is legal.

comment:2 Changed 10 years ago by cdleary

Owner: changed from nobody to cdleary
Status: newassigned

I figured the HTML was legal, but was questioning whether all browsers targeted by the Django framework support it as a CSS identifier. There are two different concerns, right?

As Dan said, w3c corrected it in CSS2.1 -- it's not in the CSS2 grammar either:

comment:3 Changed 10 years ago by Daniel Pope <dan@…>

In my experience all browsers have supported _ in selectors for as long as I can remember.

comment:4 Changed 10 years ago by Julian Bez

milestone: post-1.0
Resolution: invalid
Status: assignedclosed

If you use a CSS validator, it will tell you there's nothing wrong with id_ selectors even in CSS 1.

The change would be backwards incompatible for no real reason.

comment:5 Changed 10 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

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