Manual Test Cases for Headers Attribute Duplicate IDs - Test 1439

Test 1439: One or more elements, not intentionally hidden in the DOM and available to assistive technologies, has a headers attribute that is set to a duplicate id.

Elements with headers attribute are outlined in purple. Duplicate IDs are highlighted in red, unique IDs in green.

Test Logic:

Common Use Cases:

Purpose:

The headers attribute explicitly associates table cells with their header cells, improving accessibility for screen reader users navigating complex tables. Each referenced header ID must be unique in the document.

N/A Tests - Should Not Be Tested

Element without headers attribute

Name
John

Elements without headers attribute are not tested

Element with empty headers attribute

Name
John

Empty headers values are ignored

Hidden element with headers (display:none)

NameAge
John

Hidden elements are excluded from testing

Hidden element with headers (visibility:hidden)

Column 1Column 2
Data

Visibility hidden elements are not tested

Element with aria-hidden="true" and headers

NameAge

aria-hidden elements are not available to assistive technologies

PASS Tests - Headers Pointing to Unique IDs

Table cell with headers pointing to unique header ID

NameAge
John25

Each cell references unique header IDs

Multiple table cells each with unique header IDs

Column 1Column 2
Data 1Data 2
Data 3Data 4

Multiple cells can reference the same unique header ID

Table cell with headers pointing to non-existent but unique ID

Data

Non-existent IDs are allowed as long as they're unique (not duplicated)

Table cell with multiple unique header IDs (space-separated)

Row 1Column A
Row 2Data

Cell references both row and column headers with unique IDs

Complex table with row and column headers (unique)

Sales Report
Q1Q2
Sales$100K$150K
Costs$80K$90K

Complex table with all unique header references

Table header cell (th) with headers attribute pointing to unique ID

Region
North
Data

Header cell references another header with unique ID

Table cell with headers to unique ID among other duplicates in DOM

NameAgeCity
John

Cell references unique ID, even though other duplicates exist in the table

FAIL Tests - Headers Pointing to Duplicate IDs

Table cell with headers pointing to duplicate header ID

NameAge
John

Header ID appears twice - cell FAILS

Multiple table cells pointing to same duplicate ID

ColumnColumn 2
Data 1Data 2

Both cells reference duplicate ID - both FAIL (2 failures)

Table cell with multiple header IDs where one is duplicate

Row 1Column 1Column 2
Data

One of the referenced IDs is duplicated - cell FAILS

Table header cell (th) with headers pointing to duplicate ID

RegionArea
North

Header cell references duplicate ID - FAILS

Complex table with duplicate header IDs

Q1Q2
Sales$100K$150K
Costs$80K$90K

Row header ID is duplicated - all 4 cells FAIL (4 failures)

Div with headers attribute pointing to duplicate ID

Header 1
Header 2
Content

Non-table element with headers pointing to duplicate ID - FAILS

FAIL Tests - Edge Cases

Table cell with headers with extra whitespace pointing to duplicate ID

NameAge
John

Whitespace is trimmed - still detects duplicate ID

Table cell with headers containing multiple IDs with duplicates

Row Row 2 Col Col 2
Data

Both referenced IDs are duplicated - cell FAILS

Table cell with headers to ID in both visible and hidden elements

Visible Header
Data

ID appears in both visible and hidden elements - still duplicated, FAILS

FAIL Tests - Multiple Failures

Mix of passing and failing table cells (1 failure)

Name Age City
JohnNYC

First cell FAILS (duplicate), second PASSES (unique)

Multiple tables with different duplicate IDs (2 failures)

Header AHeader B
Data 1

Header CHeader D
Data 2

Each table has cells referencing different duplicate IDs - both FAIL (2 failures)

Real World Examples

PASS: Proper data table with unique row and column headers

Monthly Sales Report
Month Revenue Profit
January $10,000 $2,000
February $12,000 $2,500

Well-formed data table with unique headers - PASSES

FAIL: Data table with duplicate header IDs

Sales Report
Period Revenue
January $10,000
February $12,000

Row header IDs are duplicated - both cells FAIL (2 failures)

PASS: Complex nested table with unique headers

Category Sales
Q1 Q2
Electronics $50K $60K

Complex table with multi-level unique headers - PASSES

FAIL: Irregular table with duplicate column header IDs

Product Price Stock
Widget $10 100

All column headers have duplicate IDs - all 3 cells FAIL (3 failures)

PASS: ARIA grid with unique headers

Name
Age
Alice
30

ARIA grid with unique header IDs - PASSES

FAIL: ARIA grid with duplicate header IDs

Name
Age
Alice
30

Column headers have duplicate IDs - both gridcells FAIL (2 failures)

PASS: Accessibility-enhanced table with scope and unique headers

Student Grades
Student Math Science
Alice 95 92
Bob 88 90

Table combines scope and headers attributes with unique IDs - PASSES

FAIL: Table with repeated section headers using duplicate IDs

Product Inventory
Electronics
Laptop
Furniture
Desk

Section headers reuse same ID - both cells FAIL (2 failures)