Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Modify advice to use figcaption as table caption #251

Closed
LJWatson opened this issue Apr 25, 2016 · 14 comments
Closed

Modify advice to use figcaption as table caption #251

LJWatson opened this issue Apr 25, 2016 · 14 comments

Comments

@LJWatson
Copy link
Collaborator

Migrated from Bugzilla #22074:
https://www.w3.org/Bugs/Public/show_bug.cgi

@stevefaulkner
If the <figure> contains only a table, is the assumption here that the <caption> would provide the accessible name for both the <figure> and the <table>?

@RababGomaa
Copy link

Thank you for looking into it. Rabab

@chaals
Copy link
Collaborator

chaals commented Apr 25, 2016

Is there any practical rationale for saying the figcaption element should be preferred in this case? It seems like an odd edge case - or is there some evidence that a lot of people put a table into a figure?

Changing should to may seems reasonable, and removing the statement entirely seems reasonable, unless there is some legacy that means one approach is actually better.

@travisleithead
Copy link
Member

I was actually wondering why we have a <figcaption> element, when we already have an aptly named <caption> element that could be re-used within a figure (kinda how <option> was reused in <datalist>. Is it too late to drop <figcaption> or is <caption> too tied up in table processing to be portable to this scenario?

@stevefaulkner
Copy link
Contributor

On 28 April 2016 at 01:33, Travis Leithead notifications@github.com wrote:

too tied up in table processing to be portable to this scenario?

I believe this is the reason for figcaption, I can find historical
discussion if it helps?

Regards

SteveF
Current Standards Work @w3c
http://www.paciellogroup.com/blog/2015/03/current-standards-work-at-w3c/

@RababGomaa
Copy link

Another argument to support removal of < figcaption > statement with data tables:

  • < caption > is the original element created for table titles. Jaws reads the list of < caption > for data table using the Tables short key. In case of using < figcaption > Jaws shows no < figcaption >s (tested with Jaws 15). I will retest with Jaws 17 and let you know if I get the same results.

@stevefaulkner it will be great if you can bring more info.

@RababGomaa
Copy link

RababGomaa commented Apr 29, 2016

https://youtu.be/ZV0a6jSda30
Here is a demo on Jaws 17 and two table titles one coded in caption and the second in figcaption.
Notice that Jaws does not recognize the table title when coded in figcaption.
Test case steps:

  1. Run JAWS and open a page with tables.
  2. Use Insert+F3 on keyboard to pull all lists > select tables list

@travisleithead
Copy link
Member

Thanks for the demo! So, <figcaption> is apparently not currently used as the caption for the table when a <figure> containing only a <table> (and the <table> has no <caption>). But what about the other way around? (Would it be appropriate to omit <figcaption> if a <figure> has only a <table> when the <table> has a <caption>?)

@chaals
Copy link
Collaborator

chaals commented May 2, 2016

In principle, either approach should work. Recommending figcaption as a replacement for caption doesn't seem very well motivated, although it probably should work - which means there are browser bugs here.

It doesn't seem illogical that a figure which only contains a table that has a caption has that caption presented as its short alternative. But that isn't what the current HTML spec says, and I doubt it is what the accessible name calculation says in the ARIA spec, although I haven't yet checked. @stevefaulkner @LJWatson @MichielBijl do you know?

In any case, I think we need tests to discover what actually works, and then we should make the spec match. @RubyDo can you post the test case somewhere so we can try it out in other systems? (Otherwise I can make a couple, but I assume you already have the thing written so it's easy).

@RababGomaa
Copy link

@chaals I updated my demo comment with steps

@stevefaulkner
Copy link
Contributor

stevefaulkner commented May 23, 2016

Have made some change: 1fa9024 in the spec after reviewing the discussion:

  • Removed the last example which had the caption and extended description in the figcaption, but no <caption> as this example is not well supported and provides no additional benefit to the other methods described.
  • added a note recommending authors always provide a caption using the caption element when one is needed.
  • added caption to an example and removed the figcaption, instead labelling the figure by referencing the caption using aria-labelledby (did this because if figure has no accessible name then its function as a grouping container is not exposed).

@LJWatson
Copy link
Collaborator Author

@stevefaulkner

This makes things much easier to read and understand. Couple of thoughts...

I would be inclined to drop the examples that use <caption> to provide descriptive/instructional information about the table. The <caption> provides the accessible name for the table, and keeping the acc name short feels like better usability to me.

Also, minor editorial nit, in the last note in section 4.9.1.1:
"NOTE: Regardless of method used to provide additional descriptive information ..."

The word "the" should be added between "of" and "method".

@chaals
Copy link
Collaborator

chaals commented May 24, 2016

@LJWatson:

I would be inclined to drop the examples that use <caption> to provide descriptive/instructional information about the table. The <caption> provides the accessible name for the table, and keeping the acc name short feels like better usability to me.

Hmm. This is a problem, because it is also used to provide a caption for sighted users, where the extra information is actually pretty valuable. I presume this dilemma is why the HTML 5 spec hoped that using figcaption would work.

Perhaps the answer is that the "further information" should be provided in the body of the figure element - meaning best practise would often be that a table is included in a figure element.

@stevefaulkner
Copy link
Contributor

stevefaulkner commented May 24, 2016

@LJWatson
Have removed the examples using the caption element.
5ebefbd
@chaals
I don't see this as a problem, the advice does not say don't provide further information, it encourages it and provides some examples of how to do so. It only says don't include it as part of the caption, as the caption is meant for a brief, not extended description of the table content.

@LJWatson
Copy link
Collaborator Author

@chaals
"Hmm. This is a problem, because it is also used to provide a caption for sighted users, where the extra information is actually pretty valuable. I presume
this dilemma is why the HTML 5 spec hoped that using  figcaption  would work."

Agree the descriptive info should be visible. The other examples suggest ways to do this and retain a programmatic association with the table, but without cluttering up the <caption> and/or acc name. Think this is the better recommendation.

@LJWatson LJWatson closed this as completed Jun 1, 2016
arronei pushed a commit to arronei/html that referenced this issue Apr 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants