[dev] RFC: Horde_Form Rewrite's XHTML Output

Chuck Hagenbuch chuck at horde.org
Sun Aug 7 22:04:22 PDT 2005


Quoting Matt Warden <mwarden at gmail.com>:

> The reason I am not using, say:
> form fieldset { ... }
> is because that would be assuming that all forms on the given page
> (or really any page that links to this stylesheet) are Horde_Forms. I
> think this is a bad choice.

I am curious why you think it's a bad choice, and I disagree on the 
assumption. You are merely assuming that all forms using the stylesheet 
are structurally similar and that they should look the same. I think 
that's a good idea, for UI consistency.

> Secondly, I could alternatively do
> something like:
> form.horde-form fieldset {...}
> everywhere, which I do in some places. Where I do not do this is (a)
> when it isn't granular enough (e.g., different classes of <input
> type="text" /> items, like number, creditcard, etc.) and when I felt

For some of these cases might it be more appropriate to have the 
wrapper div get the creditcard class? Then style everything inside it 
based on that.

> Given this reasoning, do you still feel like I should use more
> selectors and less class names, where possible?

Yes, but just where possible. I appreciate the point about 
customization, and so that may be what you have now or a bit less. The 
reason I'd like to see as few classes as possible is that each class="" 
is a bit of presentation information, not semantic information - or 
worse, semantic information passed along as presentation information.

Interestingly it's sometimes also behavior layer, instead of 
presentation or data. Things like class="form-required" specify 
presentation but also should ideally specify behavior - the form 
javascript, if the user agent allows, should prevent the user from 
submitting the form with required elements empty. And an attempt to do 
so should result, behaviorally, in a presentation change to highlight 
the missing fields.

This is getting a bit philisophical, but here are some links:
http://digital-web.com/articles/forms_usability_and_the_w3c_dom/
http://www.sitepoint.com/article/standards-compliant-world

> For the record, I started out using an unordered list. Would you find
> this more semantically correct? I decided against it because it
> imposes a certain presentational idea, which I thought we were trying
> to get away from. However, the presentational idea might be quite
> appropriate for a form. Thoughts?

I think that actually an unordered list imposes a semantic meaning 
that's incorrect, because a form can be ordered. And also unorded, so I 
don't think an ordered list is right either.

This is sort of the ideal I have in mind:
http://www.quirksmode.org/css/forms.html

Of course a lot of the more complicated elements would want some sort 
of a container anyway, so if you're saying that we should be consistent 
and put everything in the same kind of container (that being the divs), 
I can probably be happy with that.

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the dev mailing list