SlideShare a Scribd company logo
CSS Display Properties
versus
HTML Semantics
• I’ve written some stuff,
• Member of W3C,
• Building for the web
since 1993,
• Learn more at
AdrianRoselli.com,
• Avoid on Twitter @aardrian.
About Adrian Roselli
CSS Display Properties
• The following can override native semantics in the browser:
• display: block
• display: inline
• display: grid
• display: flex
• display: contents
CSS Display Properties
• Nothing in the HTML / CSS specifications mandates this,
• Does not work in reverse:
• display: table
• display: table-cell
Assistive Technology (AT)
• Browsers do not convey correct semantics to AT,
• Users who rely on these semantics can be stranded:
• Understanding content,
• Navigating a page.
Tables as a Canary
• Breaking semantics of any single required child element can
break entire table:
• A missing row, column or row header;
• The parent table even with good rows and cells.
Accessibility Tree
• A sub/super-set of the DOM,
• Includes UI objects of browser & objects of the document,
• Created in tree for every DOM element that:
• Fires an accessibility event,
• Has a property, relationship or feature which needs to be exposed.
• Is abstracted for dev tools.
Accessibility Tree: <table>
Accessibility Tree: <caption>
Accessibility Tree: <th>
Accessibility Tree: <td>
Chrome 86 / Windows 10
CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button>
display: flex ✔ ✔ ✔ ✔
display: grid ✔ ✔ ✔ ✔
display: block ✔ ✔ ✔ ✔
display: inline-block ✔ ✔ ✔ ✔
display: contents ✔ ❌ ✔ ✔
Firefox 82 / Windows 10
CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button>
display: flex ❌1 ✔ ✔ ✔
display: grid ❌1 ✔ ✔ ✔
display: block ✔ ✔ ✔ ✔
display: inline-block ✔ ✔2 ✔ ✔
display: contents ✔ ✔2 ✔ ✔3
Safari / macOS 10.15.6
CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button>
display: flex ❌1 ✔4 ✔ ✔
display: grid ❌1 ✔4 ✔ ✔
display: block ❌2 ❌ ✔ ✔
display: inline-block ❌2 ❌ ✔ ✔
display: contents ❌3 ❌ ❌ ❌
Chrome 86 / Android 11
CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button>
display: flex ✔ ✔ ✔ ✔
display: grid ✔ ✔ ✔ ✔
display: block ✔ ✔ ✔ ✔
display: inline-block ✔ ✔ ✔ ✔
display: contents ✔ ❌1 ✔ ✔
Safari / iOS 14
CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button>
display: flex ❌ ✔ ✔ ✔
display: grid ❌ ✔ ✔ ✔
display: block ❌1 ❌2 ✔ ✔
display: inline-block ❌1 ❌2 ✔ ✔
display: contents ❌1 ❌2 ❌ ❌3
display: table
• display: table, table-caption, table-row, table-cell;
• Each of these will add layout-table semantics in Chrome v80+,
• There is no CSS display property for col/row headers,
• Requires a well-structured DOM,
• Not a workaround, fix, or way to do <div>s-as-tables.
display: table
• As LayoutTable, LayoutRowTable, LayoutCellTable;
• JAWS, Narrator will read this as a table,
– But without col/row headers,
• NVDA, VO, TalkBack will not read this as a table.
ARIA TO THE RESCUE?
ARIA Table Roles
• <table role="table">
• <caption role="caption">
• <thead|tbody|tfoot role="rowgroup">
• <tr role="row">
• <td role="cell">
• <th scope="col" role="columnheader">
• <th scope="row" role="rowheader">
• Cannot address re-ordered
content,
• Cannot address hidden
content.
ARIA Table Roles
• Do not use ARIA grid roles,
• Test with a screen reader,
• If your tables are generated from script, update the script.
Table with ARIA
<table id="Books" role="table">
<caption id="Cap1" role="caption">Books I May or May Not Have Read</caption>
<tr role="row">
<th role="columnheader">Author</th>
<th role="columnheader">Title</th>
<th role="columnheader">Year</th>
<th role="columnheader">ISBN-13</th>
<th role="columnheader">ISBN-10</th>
</tr>
<tr role="row">
<td role="cell">Miguel De Cervantes</td>
<td role="cell">The Ingenious Gentleman Don Quixote of La Mancha</td>
<td role="cell">1605</td>
<td role="cell">9783125798502</td>
<td role="cell">3125798507</td>
</tr>
[…]
<tr role="row">
<td role="cell">George Orwell</td>
<td role="cell">Nineteen Eighty-Four</td>
<td role="cell">1948</td>
<td role="cell">9780451524935</td>
<td role="cell">0451524934</td>
</tr>
</table>
What is display: contents
• The element does not generate any boxes,
• Its children and pseudo-elements still generate boxes,
• Text runs as normal,
• For box generation & layout, element treated as if replaced in
element tree by its contents,
• As if opening and closing tags removed,
• Also yanks it from accessibility tree.
Why It Is More Dangerous
• You cannot add it back to the accessibility tree with ARIA,
• You can give it an accessible name and properties,
• But these are not passed to screen readers,
• Some browsers do not hand the information off,
• If used as a poor-dev’s CSS reset:
• Will hide elements from assistive technology,
• Will hide semantics from assistive technology.
HOW IS THIS A THING?
Assistive Tech Is Not at Fault
• Not screen readers’ fault,
• Accessibility information comes from browser,
• Screen reader needs more than DOM to understand page,
• Cannot ignore all but the DOM:
• Years of HTML tables for layout informed screen readers,
• Screen readers developed heuristics for dealing with tables.
Detecting AT Is Not Viable
• Users generally don’t want us to be able to detect screen
readers,
• Not all screen reader users are blind anyway,
• Mouse actions are a poor proxy for sighted screen reader
users,
• Disabling a site’s CSS for screen reader users is impractical (and
a terrible, terrible idea).
CSS Is Not Blameless
• CSS already impacts HTML semantics — display: none,
• Using display: table does (generally) not impart HTML table
semantics,
• CSS flex or grid makes it easy for content order and source
order to disagree,
• CSS grid to lay out an HTML table still won’t be a table
semantically.
ARIA Is Not Ideal
• You must understand ARIA and the table structure,
• This will require you to keep current on SR and browser
support,
• You have to manage headers and other content you might
hide,
• Consider how this scales with CSS does not load,
• This is not the purpose of ARIA,
• The technique here is a stop-gap.
The Browser Is Not Right
• The CSS spec does not state that semantics should be dropped,
• As display properties, there is no reason to remove them,
• The accessibility tree should not care about visuals.
WRAP-UP
CSS Display Properties
versus
HTML Semantics

More Related Content

More from Adrian Roselli

Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018Adrian Roselli
 
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...Adrian Roselli
 
Fringe Accessibility — Portland UX
Fringe Accessibility — Portland UXFringe Accessibility — Portland UX
Fringe Accessibility — Portland UXAdrian Roselli
 
WCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML SemanticsWCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML SemanticsAdrian Roselli
 
Mind Your Lang — London Web Standards
Mind Your Lang — London Web StandardsMind Your Lang — London Web Standards
Mind Your Lang — London Web StandardsAdrian Roselli
 
Inclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp LondonInclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp LondonAdrian Roselli
 
CSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack OverflowCSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack OverflowAdrian Roselli
 
Inclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCampInclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCampAdrian Roselli
 
Selfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It BuffaloSelfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It BuffaloAdrian Roselli
 
Everything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack OverflowEverything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack OverflowAdrian Roselli
 
Selfish Accessibility — WordCamp Europe 2017
Selfish Accessibility — WordCamp Europe 2017Selfish Accessibility — WordCamp Europe 2017
Selfish Accessibility — WordCamp Europe 2017Adrian Roselli
 
Inclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility ConferenceInclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility ConferenceAdrian Roselli
 
Selfish Accessibility: MinneWebCon 2017
Selfish Accessibility: MinneWebCon 2017Selfish Accessibility: MinneWebCon 2017
Selfish Accessibility: MinneWebCon 2017Adrian Roselli
 
Fringe Accessibility: London Web Standards
Fringe Accessibility: London Web StandardsFringe Accessibility: London Web Standards
Fringe Accessibility: London Web StandardsAdrian Roselli
 
Selfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital ServiceSelfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital ServiceAdrian Roselli
 
Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017Adrian Roselli
 
Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)Adrian Roselli
 
Implementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility TorontoImplementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility TorontoAdrian Roselli
 
Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016Adrian Roselli
 
Role = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish AccessibilityRole = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish AccessibilityAdrian Roselli
 

More from Adrian Roselli (20)

Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018Prototyping Accessibility - WordCamp Europe 2018
Prototyping Accessibility - WordCamp Europe 2018
 
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
Guelph A11y Conf: Everything I Know About Accessibility I Learned from Stack ...
 
Fringe Accessibility — Portland UX
Fringe Accessibility — Portland UXFringe Accessibility — Portland UX
Fringe Accessibility — Portland UX
 
WCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML SemanticsWCBuf: CSS Display Properties versus HTML Semantics
WCBuf: CSS Display Properties versus HTML Semantics
 
Mind Your Lang — London Web Standards
Mind Your Lang — London Web StandardsMind Your Lang — London Web Standards
Mind Your Lang — London Web Standards
 
Inclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp LondonInclusive Usability Testing - WordCamp London
Inclusive Usability Testing - WordCamp London
 
CSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack OverflowCSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
CSUN 2018: Everything I Know About Accessibility I Learned from Stack Overflow
 
Inclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCampInclusive Usability Testing — a11yTOCamp
Inclusive Usability Testing — a11yTOCamp
 
Selfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It BuffaloSelfish Accessibility - Girl Develop It Buffalo
Selfish Accessibility - Girl Develop It Buffalo
 
Everything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack OverflowEverything I Know About Accessibility I Learned from Stack Overflow
Everything I Know About Accessibility I Learned from Stack Overflow
 
Selfish Accessibility — WordCamp Europe 2017
Selfish Accessibility — WordCamp Europe 2017Selfish Accessibility — WordCamp Europe 2017
Selfish Accessibility — WordCamp Europe 2017
 
Inclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility ConferenceInclusive User Testing — Guelph Accessibility Conference
Inclusive User Testing — Guelph Accessibility Conference
 
Selfish Accessibility: MinneWebCon 2017
Selfish Accessibility: MinneWebCon 2017Selfish Accessibility: MinneWebCon 2017
Selfish Accessibility: MinneWebCon 2017
 
Fringe Accessibility: London Web Standards
Fringe Accessibility: London Web StandardsFringe Accessibility: London Web Standards
Fringe Accessibility: London Web Standards
 
Selfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital ServiceSelfish Accessibility: Government Digital Service
Selfish Accessibility: Government Digital Service
 
Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017Selfish Accessibility: WordCamp London 2017
Selfish Accessibility: WordCamp London 2017
 
Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)Mind your lang (for role=drinks at CSUN 2017)
Mind your lang (for role=drinks at CSUN 2017)
 
Implementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility TorontoImplementing Accessibility: Accessibility Toronto
Implementing Accessibility: Accessibility Toronto
 
Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016Mind Your lang — Accessibility Camp Toronto 2016
Mind Your lang — Accessibility Camp Toronto 2016
 
Role = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish AccessibilityRole = Drinks 2016: Selfish Accessibility
Role = Drinks 2016: Selfish Accessibility
 

Recently uploaded

How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?Linksys Velop Login
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfOndejSur
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresencePC Doctors NET
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideVarun Mithran
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfappinfoedgeca
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyDamar Juniarto
 
Topology of the Network class 8 .ppt pdf
Topology of the Network class 8 .ppt pdfTopology of the Network class 8 .ppt pdf
Topology of the Network class 8 .ppt pdfAnushkaTripathi61
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appscristianmanaila2
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxChloeMeadows1
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsrahman018755
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebJie Liau
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxabhinandnam9997
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsrahman018755
 
Case study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxCase study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxAnkitscribd
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkklolsDocherty
 

Recently uploaded (16)

How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
Topology of the Network class 8 .ppt pdf
Topology of the Network class 8 .ppt pdfTopology of the Network class 8 .ppt pdf
Topology of the Network class 8 .ppt pdf
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
Article writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptxArticle writing on excessive use of internet.pptx
Article writing on excessive use of internet.pptx
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
Case study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptxCase study on merger of Vodafone and Idea (VI).pptx
Case study on merger of Vodafone and Idea (VI).pptx
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 

a11yTO CONF 2020: CSS Display Properties v. HTML Semantics

  • 2. • I’ve written some stuff, • Member of W3C, • Building for the web since 1993, • Learn more at AdrianRoselli.com, • Avoid on Twitter @aardrian. About Adrian Roselli
  • 3. CSS Display Properties • The following can override native semantics in the browser: • display: block • display: inline • display: grid • display: flex • display: contents
  • 4. CSS Display Properties • Nothing in the HTML / CSS specifications mandates this, • Does not work in reverse: • display: table • display: table-cell
  • 5. Assistive Technology (AT) • Browsers do not convey correct semantics to AT, • Users who rely on these semantics can be stranded: • Understanding content, • Navigating a page.
  • 6. Tables as a Canary • Breaking semantics of any single required child element can break entire table: • A missing row, column or row header; • The parent table even with good rows and cells.
  • 7.
  • 8. Accessibility Tree • A sub/super-set of the DOM, • Includes UI objects of browser & objects of the document, • Created in tree for every DOM element that: • Fires an accessibility event, • Has a property, relationship or feature which needs to be exposed. • Is abstracted for dev tools.
  • 13. Chrome 86 / Windows 10 CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button> display: flex ✔ ✔ ✔ ✔ display: grid ✔ ✔ ✔ ✔ display: block ✔ ✔ ✔ ✔ display: inline-block ✔ ✔ ✔ ✔ display: contents ✔ ❌ ✔ ✔
  • 14. Firefox 82 / Windows 10 CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button> display: flex ❌1 ✔ ✔ ✔ display: grid ❌1 ✔ ✔ ✔ display: block ✔ ✔ ✔ ✔ display: inline-block ✔ ✔2 ✔ ✔ display: contents ✔ ✔2 ✔ ✔3
  • 15. Safari / macOS 10.15.6 CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button> display: flex ❌1 ✔4 ✔ ✔ display: grid ❌1 ✔4 ✔ ✔ display: block ❌2 ❌ ✔ ✔ display: inline-block ❌2 ❌ ✔ ✔ display: contents ❌3 ❌ ❌ ❌
  • 16. Chrome 86 / Android 11 CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button> display: flex ✔ ✔ ✔ ✔ display: grid ✔ ✔ ✔ ✔ display: block ✔ ✔ ✔ ✔ display: inline-block ✔ ✔ ✔ ✔ display: contents ✔ ❌1 ✔ ✔
  • 17. Safari / iOS 14 CSS <table>, etc. <ul>, <ol>, <dl> <h#> <button> display: flex ❌ ✔ ✔ ✔ display: grid ❌ ✔ ✔ ✔ display: block ❌1 ❌2 ✔ ✔ display: inline-block ❌1 ❌2 ✔ ✔ display: contents ❌1 ❌2 ❌ ❌3
  • 18. display: table • display: table, table-caption, table-row, table-cell; • Each of these will add layout-table semantics in Chrome v80+, • There is no CSS display property for col/row headers, • Requires a well-structured DOM, • Not a workaround, fix, or way to do <div>s-as-tables.
  • 19.
  • 20. display: table • As LayoutTable, LayoutRowTable, LayoutCellTable; • JAWS, Narrator will read this as a table, – But without col/row headers, • NVDA, VO, TalkBack will not read this as a table.
  • 21. ARIA TO THE RESCUE?
  • 22. ARIA Table Roles • <table role="table"> • <caption role="caption"> • <thead|tbody|tfoot role="rowgroup"> • <tr role="row"> • <td role="cell"> • <th scope="col" role="columnheader"> • <th scope="row" role="rowheader"> • Cannot address re-ordered content, • Cannot address hidden content.
  • 23. ARIA Table Roles • Do not use ARIA grid roles, • Test with a screen reader, • If your tables are generated from script, update the script.
  • 24. Table with ARIA <table id="Books" role="table"> <caption id="Cap1" role="caption">Books I May or May Not Have Read</caption> <tr role="row"> <th role="columnheader">Author</th> <th role="columnheader">Title</th> <th role="columnheader">Year</th> <th role="columnheader">ISBN-13</th> <th role="columnheader">ISBN-10</th> </tr> <tr role="row"> <td role="cell">Miguel De Cervantes</td> <td role="cell">The Ingenious Gentleman Don Quixote of La Mancha</td> <td role="cell">1605</td> <td role="cell">9783125798502</td> <td role="cell">3125798507</td> </tr> […] <tr role="row"> <td role="cell">George Orwell</td> <td role="cell">Nineteen Eighty-Four</td> <td role="cell">1948</td> <td role="cell">9780451524935</td> <td role="cell">0451524934</td> </tr> </table>
  • 25. What is display: contents • The element does not generate any boxes, • Its children and pseudo-elements still generate boxes, • Text runs as normal, • For box generation & layout, element treated as if replaced in element tree by its contents, • As if opening and closing tags removed, • Also yanks it from accessibility tree.
  • 26. Why It Is More Dangerous • You cannot add it back to the accessibility tree with ARIA, • You can give it an accessible name and properties, • But these are not passed to screen readers, • Some browsers do not hand the information off, • If used as a poor-dev’s CSS reset: • Will hide elements from assistive technology, • Will hide semantics from assistive technology.
  • 27. HOW IS THIS A THING?
  • 28. Assistive Tech Is Not at Fault • Not screen readers’ fault, • Accessibility information comes from browser, • Screen reader needs more than DOM to understand page, • Cannot ignore all but the DOM: • Years of HTML tables for layout informed screen readers, • Screen readers developed heuristics for dealing with tables.
  • 29. Detecting AT Is Not Viable • Users generally don’t want us to be able to detect screen readers, • Not all screen reader users are blind anyway, • Mouse actions are a poor proxy for sighted screen reader users, • Disabling a site’s CSS for screen reader users is impractical (and a terrible, terrible idea).
  • 30. CSS Is Not Blameless • CSS already impacts HTML semantics — display: none, • Using display: table does (generally) not impart HTML table semantics, • CSS flex or grid makes it easy for content order and source order to disagree, • CSS grid to lay out an HTML table still won’t be a table semantically.
  • 31. ARIA Is Not Ideal • You must understand ARIA and the table structure, • This will require you to keep current on SR and browser support, • You have to manage headers and other content you might hide, • Consider how this scales with CSS does not load, • This is not the purpose of ARIA, • The technique here is a stop-gap.
  • 32. The Browser Is Not Right • The CSS spec does not state that semantics should be dropped, • As display properties, there is no reason to remove them, • The accessibility tree should not care about visuals.
  • 34.

Editor's Notes

  1. CSS as implemented in browsers today can remove semantics, Conversely, you can not add it back with CSS
  2. CSS as implemented in browsers today can remove semantics, Conversely, you can not add it back with CSS
  3. If any one part of a valid table goes away, the entire thing falls down. Mis-count of rows or columns, Headers associated with wrong data. Harder to see this in action with elements that do not have so many required children in a required structure. A broken table means your code may have this elsewhere.
  4. Github just wanted to prevent wide tables from breaking its layout. It made the table scrollable instead of a container. To do that required .markdown-body table {display: block;}. That made the table useless to SR and keyboard users.
  5. Table before CSS display properties on the left Table after CSS display properties on the right Note how the entire accessibility tree is gone
  6. Caption before CSS display properties on the left Caption after CSS display properties on the right Its caption role is maintained But it is not associated with a table
  7. Th before CSS display properties on the left Th after CSS display properties on the right Not associated with the table No computed properties
  8. Td before CSS display properties on the left Td after CSS display properties on the right Not associated with the table No computed properties
  9. Chrome 80 does well with flex, grid, block, inline-block, and contents. Across tables, lists, headings, and buttons. Except lists with display: contents.
  10. <th>s with flex and grid are announced as cells, not col or row header, Inserts text leaf between each one, Issues a keyboard use warning (interactive elements must be focusable).
  11. Recognizes <table> and <caption> only; not <tr>, <th>, <td> Can navigate in VO with table commands, but column/row headers not conveyed Can navigate by row in VO, but just as a string of text. VO breaks up any text that wraps
  12. Chrome 80 does well with flex, grid, block, inline-block, and contents. Across tables, lists, headings, and buttons. Except lists with display: contents. Essentially performs as desktop Does not announce list count, position, start, end even unstyled, but does announce list on exit for Contents.
  13. Treats all cells belonging in column 1. Recognizes <dl> overall -- must have come with them finally fixing <dl>s. Still fires on double-tap with VO.
  14. If you create a structure like a table and add table-related display styles, Chrome calls it a layout table.
  15. There is a long aversion to tables owing to their mis-use for layout. So some people try to use other HTML elements, They opt to “throw ARIA” at them.
  16. You can use ARIA to re-insert lost semantics Caption role coming in ARIA 1.2
  17. Grid slides coming up
  18. I am seeing this quickly become the new hotness. I want to call this one out specifically.
  19. You may ask yourself: where is my beautiful table? You may ask yourself: where are the table semantics? And you may ask yourself: why is this so broken?
  20. Because developers used layout tables for years, SRs had to improvise to make them useable. Still using tables as my proxy, focus on SRs (which are not the only AT).
  21. How do you account for those with mobility impairments who do not use a mouse? Or mobile screen reader users who rely on touch gestures
  22. Think about how it used for vertical centering because vertical centering was not a thing in CSS for so long
  23. First Rule of ARIA! As ARIA fixes it in browser exposure, should help other AT.
  24. If CSS is your bag, or figuring out if or why your CSS is breaking everything, you may want to stick around for Manuel Matuzovic’s talk on CSS and accessibility, or Sarah Higley’s talk on how to track down root causes of issues.