[jifty-devel] Re: [Jifty-commit] r1350 - in jifty/trunk: . lib/Jifty lib/Jifty/Web lib/Jifty/Web/Form/Field share/web/static/css share/web/templates/_elements

Sean E. Millichamp sean at enertronllc.com
Thu Jun 22 16:51:04 EDT 2006


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20060622/0dbc9abc/attachment.pgp


More information about the jifty-devel mailing list