Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-10-22 12:20:17

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Strip the fieldset tags out of admin side

I’m probably going to do this anyway, but wanted to post here first. I’m thinking of removing the <fieldset> and <legend> tags on the admin-side pages – e.g. the write page – in favour of simple <div> tags (or even <section> tags if that makes more sense after I review it).

A few reasons for this:

  1. There is currently a nonsensical mixture of form field groups in <div> regions (such as ‘Comment options’) and <fieldset> regions. Neither of those regions have any importance over the other, so they should share a common region type.
  2. <div> tags provide much more flexible options to add WAI-ARIA information which in turn makes the page more accessible to those with impairments. For example screen readers can take advantage of role=region to logically group important sections of the page.
  3. <legend> tags are notoriously tricky to style nicely across different browsers (due to their inconsistent base CSS rules).

Any objections with good reason then let me know.

Offline

#2 2012-10-22 21:43:47

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Strip the fieldset tags out of admin side

Sounds like a plan…. no objections here

Offline

#3 2012-10-23 08:00:48

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

Re: Strip the fieldset tags out of admin side

philwareham wrote:

No particular objection from me, neither pro nor con. As long as the end result is well structured. However I wanted to nitpick on this:

  1. <div> tags provide much more flexible options to add WAI-ARIA information which in turn makes the page more accessible to those with impairments. For example screen readers can take advantage of role=region to logically group important sections of the page.

fieldset / legend already have a solid built-in accessibility information, no need upfront to add any WAI-ARIA attributes (those aren’t any of those ‘fancy new html5 thingies’).

However, considering the eclectic mix that are some of the forms in the back-end (bits of divs here, bits of fieldsets there, then mix hard), they are probably harder for accessibility tools to map them in the total of the form. (I always have a hard time evaluating those from a screen reader perspective, due to hearing problems.)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2012-10-23 08:21:16

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Strip the fieldset tags out of admin side

@philw13

Exactly, if fieldsets had been used everywhere consistently it wouldn’t have been a problem – but the mix we have at the moment just doesn’t work for accessibility. I’ll settle on the <div> tag because it can be used in and out of a form setting, and is easier to style with CSS too.

I’ve not been able to find much info on whether a <fieldset> is actually treated as a role=region either by default, this document seems to omit it completely. Adding role attributes to fieldset also also results in invalid code.

The use of aria can describe the content anyway, so using non-semantic divs is fine (or I may use <section> tags in the end – not sure yet).

Offline

#5 2012-10-23 09:06:31

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

Re: Strip the fieldset tags out of admin side

philwareham wrote:

I’ve not been able to find much info on whether a <fieldset> is actually treated as a role=region either by default…

This document list it as role="group" (authored by Seve Faulkner). That matches the description in HTML5 (and 4).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#6 2012-10-23 09:33:04

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Strip the fieldset tags out of admin side

Ah ok thanks. This aria stuff has been pretty interesting to learn so far (although its a bit convoluted and not very well documented in places).

Offline

#7 2012-10-24 09:03:20

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

Re: Strip the fieldset tags out of admin side

philwareham wrote:

Ah ok thanks. This aria stuff has been pretty interesting to learn so far (although its a bit convoluted and not very well documented in places).

I find the WAI-ARIA spec very hard to read (more so for non-native english speaker(s)…). They need a decent spec writer who also thinks about authors.

BTW I meant to mention that before: I would go with sections. Those are implicitly landmarks and [role=region]. Even nested in sections (e.g. the parent columns on the write tab).

edit: grammar

Last edited by phiw13 (2012-10-24 09:04:15)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#8 2012-10-24 10:00:14

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Strip the fieldset tags out of admin side

Ok, sounds like a plan. Will use sections.

Offline

Board footer

Powered by FluxBB