any element pointed @headers attribute should be exposed as table header

RESOLVED FIXED in mozilla24

Status

()

Core
Disability Access APIs
RESOLVED FIXED
6 years ago
4 years ago

People

(Reporter: surkov, Assigned: surkov)

Tracking

(Blocks: 2 bugs)

unspecified
mozilla24
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
spun off bug 702978 comment #2-#3.
(Assignee)

Comment 1

6 years ago
Steve, but if we are going to expose any element pointed by @headers attribute then we need to decide whether it should be exposed as column header or as row header (that APIs requires us to do). We could exposed those unmapped as relations like labelled_by but I'm not sure. Ideas?

Comment 2

6 years ago
OK, I was assuming that headers references can/should only be pointing to col/row headers in the same table, as per spec:

http://dev.w3.org/html5/spec-author-view/attributes-common-to-td-and-th-elements.html#attr-tdth-headers

"The td and th element may have a headers content attribute specified. The headers attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of a th element taking part in the same table as the td or th element."
(Assignee)

Updated

4 years ago
Duplicate of this bug: 877386
(Assignee)

Comment 4

4 years ago
Note, bug 877386 has an example, testcase and some discussion.
(Assignee)

Comment 5

4 years ago
Created attachment 757281 [details] [diff] [review]
patch

it seems the best what we can do here is summarized by bug 877386 "Table headers not associated when header is a td element with no scope"
Assignee: nobody → surkov.alexander
Status: NEW → ASSIGNED
Attachment #757281 - Flags: review?(trev.saunders)
Comment on attachment 757281 [details] [diff] [review]
patch

I'll never understand why html was designed this way but I guess we have to deal.
Attachment #757281 - Flags: review?(trev.saunders) → review+

Comment 7

4 years ago
To make matters more confusing, HTML 4.01 and HTML 5 say different things about this.

HTML 4.01 says headers can point at either td or th:
> Note that it's not always possible to make a clean division of cells into headers or data. You should use the TD element for such cells together with the id or scope attributes as appropriate.
(http://www.w3.org/TR/html4/struct/tables.html#h-11.4.1)

HTML 5 (as referenced in comment 2) says headers can only point at th:
> The td and th element may have a headers content attribute specified. The headers attribute, if specified, must contain a string consisting of an unordered set of unique space-separated tokens that are case-sensitive, each of which must have the value of an ID of a th element taking part in the same table as the td or th element.
(http://dev.w3.org/html5/spec-author-view/attributes-common-to-td-and-th-elements.html#attr-tdth-headers)

I guess we still need to support HTML 4.01. :(
(Assignee)

Comment 8

4 years ago
the example above seems valid (th has styling, td doesn't have so using td to describe other cells seems reasonable and thus it's also reasonable to expose them as headers).

Steve, you know why HTML5 doesn't allow td anymore?
Flags: needinfo?(faulkner.steve)
(Assignee)

Comment 9

4 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/c2c4b87b2a6f
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/c2c4b87b2a6f
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24

Comment 11

4 years ago
(In reply to alexander :surkov from comment #8)
> the example above seems valid (th has styling, td doesn't have so using td
> to describe other cells seems reasonable and thus it's also reasonable to
> expose them as headers).
> 
> Steve, you know why HTML5 doesn't allow td anymore?

I don't know why (wasn't my doing and can't find paper trail). My advice would be to honour the headers relationships whether they point to td or th. The forbidding of headers references being a td should only be for authors not implementers. If this is not clear in the spec [1], please file a bug [2]

[1] http://www.w3.org/html/wg/drafts/html/master/tabular-data.html#attr-tdth-headers
[2] https://www.w3.org/Bugs/Public/enter_bug.cgi?product=HTML%20WG&component=HTML5%20spec&priority=P3
(Assignee)

Updated

4 years ago
Flags: needinfo?(faulkner.steve)
The parts of the spec that were being cited in this bug are the wrong parts of the spec, by the way. Those are the authoring requirements. For a browser, you only want to be looking at the conformance requirements for user agents, which do require that headers="" work whether pointing to a <td> or a <th>:
http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#header-and-data-cell-semantics
You need to log in before you can comment on or make changes to this bug.