Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#8440 closed (invalid)

Change forms default auto_id='id-%s'

Reported by: cdleary@… Owned by: cdleary
Component: Forms Version: dev
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

Description

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 http://www.w3.org/TR/REC-CSS1#appendix-b:

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.

Cheers,

Chris

Attachments (1)

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

Download all attachments as: .zip

Change History (6)

by cdleary@…, 16 years ago

Attachment: auto_id.diff added

Simple proposal auto_id patch.

comment:1 by Daniel Pope <dan@…>, 16 years ago

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

comment:2 by cdleary, 16 years ago

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 by Daniel Pope <dan@…>, 16 years ago

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

comment:4 by Julian Bez, 16 years ago

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 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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