[jifty-devel] Re: [Jifty-commit] r1350 - in jifty/trunk:
.lib/Jifty lib/Jifty/Web lib/Jifty/Web/Form/Field
share/web/static/cssshare/web/templates/_elements
Bart Bunting
bart at bunting.net.au
Thu Jun 22 20:04:51 EDT 2006
I think that should be fine. As long as we keep the label elements for the
forms.
Bart
-----Original Message-----
From: jifty-devel-bounces at lists.jifty.org
[mailto:jifty-devel-bounces at lists.jifty.org] On Behalf Of Sean E. Millichamp
Sent: Friday, June 23, 2006 6:51 AM
To: Nifty apps in a Jiffy
Subject: Re: [jifty-devel] Re: [Jifty-commit] r1350 - in jifty/trunk:
.lib/Jifty lib/Jifty/Web lib/Jifty/Web/Form/Field
share/web/static/cssshare/web/templates/_elements
On Thu, 2006-06-22 at 15:19 -0400, Alex Vandiver wrote:
> On Thu, 2006-06-22 at 15:10 -0400, jifty-commit at lists.jifty.org wrote:
> > Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
> >
============================================================================
==
> > --- jifty/trunk/lib/Jifty/Web/Form/Field.pm (original)
> > +++ jifty/trunk/lib/Jifty/Web/Form/Field.pm Thu Jun 22 15:10:15 2006
> > @@ -375,9 +375,15 @@
> >
> > sub render_label {
> > my $self = shift;
> > - Jifty->web->out(
> > + if ( $self->render_mode eq 'update' ) {
> > + Jifty->web->out(
> > qq!<label class="label @{[$self->classes]}" for="@{[$self->element_id
]}">@{[_($self->label) ]}</label>\n!
> > - );
> > + );
> > + } else {
> > + Jifty->web->out(
> > + qq!<span class="label
@{[$self->classes]}">@{[_($self->label) ]}</span>\n!
> > + );
> > + }
> >
> > return '';
> > }
>
> This hunk breaks screen-readers and the like, which, for proper HTML
> accessibility, need a <label> element. What's the error that this was
> trying to fix?
I actually figured that this would be a fairly unobtrusive change, but I
hadn't considered screen readers.
Mostly as an academic exercise, I was trying to see if I could get Jifty
closer to XHTML 1.0 Strict validation without visibly changing the pages
I was testing with.
The <label> elements were causing errors since most of the form field
values were rendering as <span> elements when render_mode was 'read' and
the <label> elements were invalid without <input> elements, and they
referenced element id's that didn't exist. Not considering screen
readers and the like, switching them from <label> to <span> seemed to
give the same behavior and rendering, and eliminated the errors.
Should I back the change out?
Sean
--
Sean E. Millichamp, Enertron LLC, 586-757-1200 x102
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/373 - Release Date: 6/22/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.2/373 - Release Date: 6/22/2006
More information about the jifty-devel
mailing list