SlideShare ist ein Scribd-Unternehmen logo
1 von 59
CSS Display Properties
versus
HTML Semantics
Presented at WordCamp Buffalo 2018
Slides will be posted at rosel.li/wcbuf
• 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
HTML Tables
HTML Tables
• We will use HTML tables as our proxy,
• They have a long history on the web,
• Used for layout and tabular data,
• Have a specific DOM structure,
• Have their own navigation features in assorted tools.
Basic HTML Table
• Just make a valid HTML <table>.
• Avoid spanning cells,
• Make sure you use <th> for headers,
• Add a useful <caption>.
Basic HTML Table
<table>
<caption>Books I May or May Not Have Read</caption>
<tr>
<th>Author</th>
<th>Title</th>
<th>Year</th>
</tr>
<tr>
<td>Miguel De Cervantes</td>
<td>The Ingenious Gentleman Don Quixote of La Mancha</td>
<td>1605</td>
</tr>
[…]
<tr>
<td>George Orwell</td>
<td>Nineteen Eighty-Four</td>
<td>1948</td>
</tr>
</table>
Complexity #1: Row Headers
• Continue to use <th>,
• Add the scope attribute using the values (as appropriate):
• row,
• col,
• rowgroup,
• colgroup.
• Conforms to WCAG technique H63: Using the scope attribute to
associate header cells and data cells in data tables.
Complexity #1: Row Headers
<table>
<caption>Contact Information</caption>
<tr>
<td></td>
<th scope="col">Name</th>
<th scope="col">Phone#</th>
<th scope="col">Fax#</th>
<th scope="col">City</th>
</tr>
<tr>
<td>1.</td>
<th scope="row">Joel Garner</th>
<td>412-212-5421</td>
<td>412-212-5400</td>
<td>Pittsburgh</td>
</tr>
[…]
</table>
Complexity #2: Spanning Cells
• Continue to use <th>,
• Every <th> gets an id,
• Every <td> gets a headers attribute
• The headers value is the id of the <th> you want it to use,
• Conforms to WCAG 2.0 technique H43: Using id and headers
attributes to associate data cells with header cells in data tables.
Complexity #2: Spanning Cells
<table>
<tr>
<th rowspan="2" id="h">Homework</th>
<th colspan="3" id="e">Exams</th>
<th colspan="3" id="p">Projects</th>
</tr>
<tr>
<th id="e1" headers="e">1</th>
<th id="e2" headers="e">2</th>
<th id="ef" headers="e">Final</th>
<th id="p1" headers="p">1</th>
<th id="p2" headers="p">2</th>
<th id="pf" headers="p">Final</th>
</tr>
<tr>
<td headers="h">15%</td>
<td headers="e e1">15%</td>
<td headers="e e2">15%</td>
<td headers="e ef">20%</td>
<td headers="p p1">10%</td>
<td headers="p p2">10%</td>
<td headers="p pf">15%</td>
</tr>
</table>
RWD
(Responsive Web Design)
Responsive Tables
• Specifically talking about viewport width,
• Just let it scroll off-screen:
• Add tabindex="0" for keyboard users,
• Add role="region“ so screen readers announce it,
• Add aria-labeledby so screen readers give it a name,
• Set the aria-labeledby value to the id of the <caption>.
Responsive Table
<div role="region" aria-labeledby="Cap1" tabindex="0">
<table>
<caption id="Cap1">Books I May or May Not Have Read</caption>
<tr>
<th>Author</th>
<th>Title</th>
<th>Year</th>
<th>ISBN-13</th>
<th>ISBN-10</th>
</tr>
<tr>
<td>Miguel De Cervantes</td>
<td>The Ingenious Gentleman Don Quixote of La Mancha</td>
<td>1605</td>
<td>9783125798502</td>
<td>3125798507</td>
</tr>
[…]
<tr>
<td>George Orwell</td>
<td>Nineteen Eighty-Four</td>
<td>1948</td>
<td>9780451524935</td>
<td>0451524934</td>
</tr>
</table>
</div>
Even More Responsive
(still tables)
Respond to Print
Respond to Windows High Contrast Mode
Respond to Viewport Width
Rejiggering the Layout
@media screen and (max-width: 37em), print and (max-width: 5in) {
table, tr, td {
display: block;
}
[…]
td {
display: grid;
grid-template-columns: 4em auto;
grid-gap: 1em 0.5em;
}
}
Rejiggering the Layout
CSS Display Properties
CSS Display Properties
• The following override native semantics in the browser:
• display: block
• display: inline
• display: grid
• display: flex
• display: contents
• 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.
Screen Reader (NVDA / Firefox)
Screen Reader (NVDA / Firefox)
Accessibility Tree
• A sub-set of the DOM tree,
• 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.
Accessibility Tree: <table>
Accessibility Tree: <caption>
Accessibility Tree: <th>
Accessibility Tree: <td>
ARIA to the Rescue?
(Accessible Rich Internet Applications)
ARIA Table Roles
• You can use ARIA to re-insert the lost semantics:
• <table role="table">
• <thead|tbody|tfoot role="rowgroup">
• <tr role="row">
• <td row="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">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>
Screen Reader (NVDA / Firefox)
ARIA Grid
ARIA Grid
• Do not use for simple data tables,
• Intended to mimic Excel-style spreadsheet,
• A grid is a composite widget so it:
• Always contains multiple focusable elements,
• Has only one focusable element in the page tab sequence,
• Requires the author to provide code that manages focus movement inside it.
• Ignoring for the purpose of this talk.
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 their own heuristics for dealing with tables.
Detecting AT Is Not Viable
• Users 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 therefore impractical
(and a terrible, terrible idea).
CSS Is Not Blameless
• CSS already impacts HTML semantics — display: none,
• Using display: table does 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 screen reader 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.
CSS Rotation
Specific to Tables
• Only works with tables with tiny data,
• Keyboard navigation can be confusing,
• You have to re-rotate contents,
• There may be some mirroring involved,
• Generally not a good idea.
Beware display: contents
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 display: contents 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,
• 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.
Affecting Different Elements
Accessibility Tree: <table>
Accessibility Tree: <ul>
Accessibility Tree: <button>
Accessibility Tree: <h2>
Screen Reader (NVDA / Firefox)
Bugs!
• Firefox bug 1455357: Setting grid item to display:contents resets its
accessible role
• Chromium Issue 835455: Element not exposed to accessibility tree
when it is set to display: contents
• Safari bug 39630240 (which I cannot see because my AppleID may
not have the needed permissions to see it)
• CSSWG #2632: [css-display][css-aam][selectors-4] How elements with
`display:contents` get focused?
Wrap-up
References
• It’s OK to Use Tables
• Hey, It’s Still OK to Use Tables
• A Responsive Accessible Table
• Tables, CSS Display Properties, and ARIA
• Tables, JSON, CSS, ARIA, RWD, TLAs…
• GitHub Contributions Chart
• Short note on what CSS display properties do to table semantics by Steve
Faulkner
• Data Tables by Heydon Pickering
• How display: contents; Works by Ire Aderinokun
• CSS3 — Appendix B: Effects of display: contents on Unusual Elements
CSS Display Properties
versus
HTML Semantics
Presented at WordCamp Buffalo 2018
Slides will be posted at rosel.li/wcbuf

Weitere ähnliche Inhalte

Was ist angesagt?

CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing worldRuss Weakley
 
Web technologies: Lesson 2
Web technologies: Lesson 2Web technologies: Lesson 2
Web technologies: Lesson 2nhepner
 
Html5 appunti.0
Html5   appunti.0Html5   appunti.0
Html5 appunti.0orestJump
 
Web front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptWeb front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptMarc Huang
 
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...Nicole Sullivan
 
Caracteristicas Basicas De Htlm
Caracteristicas Basicas De HtlmCaracteristicas Basicas De Htlm
Caracteristicas Basicas De HtlmMaria S Rivera
 
Practical file(XHTML)web designing
Practical file(XHTML)web designingPractical file(XHTML)web designing
Practical file(XHTML)web designingArtiSolanki5
 
Modular HTML & CSS
Modular HTML & CSSModular HTML & CSS
Modular HTML & CSSShay Howe
 
Css for Development
Css for DevelopmentCss for Development
Css for Developmenttsengsite
 
Zero One Or Many Namespaces
Zero One Or Many NamespacesZero One Or Many Namespaces
Zero One Or Many NamespacesLiquidHub
 
Concept of CSS unit3
Concept of CSS unit3Concept of CSS unit3
Concept of CSS unit3SURBHI SAROHA
 
3 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 202101053 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 20210105John Picasso
 

Was ist angesagt? (20)

CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
CSS: a rapidly changing world
CSS: a rapidly changing worldCSS: a rapidly changing world
CSS: a rapidly changing world
 
Unit 3 (it workshop).pptx
Unit 3 (it workshop).pptxUnit 3 (it workshop).pptx
Unit 3 (it workshop).pptx
 
Html Tags
Html TagsHtml Tags
Html Tags
 
Web technologies: Lesson 2
Web technologies: Lesson 2Web technologies: Lesson 2
Web technologies: Lesson 2
 
Tybscrc
TybscrcTybscrc
Tybscrc
 
Html5 appunti.0
Html5   appunti.0Html5   appunti.0
Html5 appunti.0
 
Web front end development introduction to html css and javascript
Web front end development introduction to html css and javascriptWeb front end development introduction to html css and javascript
Web front end development introduction to html css and javascript
 
Html cia
Html ciaHtml cia
Html cia
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective,  Ajax ...
The Cascade, Grids, Headings, and Selectors from an OOCSS Perspective, Ajax ...
 
Caracteristicas Basicas De Htlm
Caracteristicas Basicas De HtlmCaracteristicas Basicas De Htlm
Caracteristicas Basicas De Htlm
 
Practical file(XHTML)web designing
Practical file(XHTML)web designingPractical file(XHTML)web designing
Practical file(XHTML)web designing
 
Modular HTML & CSS
Modular HTML & CSSModular HTML & CSS
Modular HTML & CSS
 
Html5 101
Html5 101Html5 101
Html5 101
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 
Zero One Or Many Namespaces
Zero One Or Many NamespacesZero One Or Many Namespaces
Zero One Or Many Namespaces
 
Concept of CSS unit3
Concept of CSS unit3Concept of CSS unit3
Concept of CSS unit3
 
3 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 202101053 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 20210105
 
Css.html
Css.htmlCss.html
Css.html
 

Ähnlich wie WCBuf: CSS Display Properties versus HTML Semantics

ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningGeorge Estebe
 
Web Accessibility for the 21st Century
Web Accessibility for the 21st CenturyWeb Accessibility for the 21st Century
Web Accessibility for the 21st Centurydreamwidth
 
Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!Gill Cleeren
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Deepak Sharma
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to BootstrapRon Reiter
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web DevelopmentNikhil Baby
 
Advance Css 1194323118268797 5
Advance Css 1194323118268797 5Advance Css 1194323118268797 5
Advance Css 1194323118268797 5dharshyamal
 
Advance Css
Advance CssAdvance Css
Advance Cssvijayta
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web DevelopmentRahul Mishra
 
Web Design Fundamentals
Web Design FundamentalsWeb Design Fundamentals
Web Design FundamentalsAhmed Faris
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introductionapnwebdev
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designersPai-Cheng Tao
 
Web fundamental concept and tags
Web fundamental concept and tags Web fundamental concept and tags
Web fundamental concept and tags shameen khan
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucksTim Wright
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scalascalaconfjp
 

Ähnlich wie WCBuf: CSS Display Properties versus HTML Semantics (20)

ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
 
Web Accessibility for the 21st Century
Web Accessibility for the 21st CenturyWeb Accessibility for the 21st Century
Web Accessibility for the 21st Century
 
Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!Comparing XAML and HTML: FIGHT!
Comparing XAML and HTML: FIGHT!
 
ARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSSARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSS
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
 
Slicing the web
Slicing the webSlicing the web
Slicing the web
 
Introduction to Bootstrap
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
 
Html forfood
Html forfoodHtml forfood
Html forfood
 
Introduction to Responsive Web Development
Introduction to Responsive Web DevelopmentIntroduction to Responsive Web Development
Introduction to Responsive Web Development
 
Advance Css 1194323118268797 5
Advance Css 1194323118268797 5Advance Css 1194323118268797 5
Advance Css 1194323118268797 5
 
Advance Css
Advance CssAdvance Css
Advance Css
 
HTML CSS and Web Development
HTML CSS and Web DevelopmentHTML CSS and Web Development
HTML CSS and Web Development
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
Web Design Fundamentals
Web Design FundamentalsWeb Design Fundamentals
Web Design Fundamentals
 
1 03 - CSS Introduction
1 03 - CSS Introduction1 03 - CSS Introduction
1 03 - CSS Introduction
 
Be nice to your designers
Be nice to your designersBe nice to your designers
Be nice to your designers
 
Web fundamental concept and tags
Web fundamental concept and tags Web fundamental concept and tags
Web fundamental concept and tags
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Solid and Sustainable Development in Scala
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
 

Mehr von Adrian Roselli

Selfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays BuffaloSelfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays BuffaloAdrian Roselli
 
Selfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF VilniusSelfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF VilniusAdrian Roselli
 
Role of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-upRole of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-upAdrian Roselli
 
The Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-upThe Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-upAdrian Roselli
 
Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019Adrian Roselli
 
Selfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKSelfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKAdrian Roselli
 
Selfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeSelfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeAdrian 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
 
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
 

Mehr von Adrian Roselli (20)

Selfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays BuffaloSelfish Accessibility —DevOpsDays Buffalo
Selfish Accessibility —DevOpsDays Buffalo
 
Selfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF VilniusSelfish Accessibility — YGLF Vilnius
Selfish Accessibility — YGLF Vilnius
 
Role of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-upRole of Design in Accessibility — VilniusJS Meet-up
Role of Design in Accessibility — VilniusJS Meet-up
 
The Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-upThe Role of Design in Accessibility — a11yTO Meet-up
The Role of Design in Accessibility — a11yTO Meet-up
 
Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019Prototyping Accessibility: Booster 2019
Prototyping Accessibility: Booster 2019
 
Selfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HKSelfish Accessibility — Harbour Front HK
Selfish Accessibility — Harbour Front HK
 
Selfish Accessibility — CodeDaze
Selfish Accessibility — CodeDazeSelfish Accessibility — CodeDaze
Selfish Accessibility — CodeDaze
 
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
 
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
 

Kürzlich hochgeladen

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 

Kürzlich hochgeladen (20)

Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 

WCBuf: CSS Display Properties versus HTML Semantics

  • 1. CSS Display Properties versus HTML Semantics Presented at WordCamp Buffalo 2018 Slides will be posted at rosel.li/wcbuf
  • 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
  • 4. HTML Tables • We will use HTML tables as our proxy, • They have a long history on the web, • Used for layout and tabular data, • Have a specific DOM structure, • Have their own navigation features in assorted tools.
  • 5. Basic HTML Table • Just make a valid HTML <table>. • Avoid spanning cells, • Make sure you use <th> for headers, • Add a useful <caption>.
  • 6. Basic HTML Table <table> <caption>Books I May or May Not Have Read</caption> <tr> <th>Author</th> <th>Title</th> <th>Year</th> </tr> <tr> <td>Miguel De Cervantes</td> <td>The Ingenious Gentleman Don Quixote of La Mancha</td> <td>1605</td> </tr> […] <tr> <td>George Orwell</td> <td>Nineteen Eighty-Four</td> <td>1948</td> </tr> </table>
  • 7. Complexity #1: Row Headers • Continue to use <th>, • Add the scope attribute using the values (as appropriate): • row, • col, • rowgroup, • colgroup. • Conforms to WCAG technique H63: Using the scope attribute to associate header cells and data cells in data tables.
  • 8. Complexity #1: Row Headers <table> <caption>Contact Information</caption> <tr> <td></td> <th scope="col">Name</th> <th scope="col">Phone#</th> <th scope="col">Fax#</th> <th scope="col">City</th> </tr> <tr> <td>1.</td> <th scope="row">Joel Garner</th> <td>412-212-5421</td> <td>412-212-5400</td> <td>Pittsburgh</td> </tr> […] </table>
  • 9. Complexity #2: Spanning Cells • Continue to use <th>, • Every <th> gets an id, • Every <td> gets a headers attribute • The headers value is the id of the <th> you want it to use, • Conforms to WCAG 2.0 technique H43: Using id and headers attributes to associate data cells with header cells in data tables.
  • 10. Complexity #2: Spanning Cells <table> <tr> <th rowspan="2" id="h">Homework</th> <th colspan="3" id="e">Exams</th> <th colspan="3" id="p">Projects</th> </tr> <tr> <th id="e1" headers="e">1</th> <th id="e2" headers="e">2</th> <th id="ef" headers="e">Final</th> <th id="p1" headers="p">1</th> <th id="p2" headers="p">2</th> <th id="pf" headers="p">Final</th> </tr> <tr> <td headers="h">15%</td> <td headers="e e1">15%</td> <td headers="e e2">15%</td> <td headers="e ef">20%</td> <td headers="p p1">10%</td> <td headers="p p2">10%</td> <td headers="p pf">15%</td> </tr> </table>
  • 12. Responsive Tables • Specifically talking about viewport width, • Just let it scroll off-screen: • Add tabindex="0" for keyboard users, • Add role="region“ so screen readers announce it, • Add aria-labeledby so screen readers give it a name, • Set the aria-labeledby value to the id of the <caption>.
  • 13. Responsive Table <div role="region" aria-labeledby="Cap1" tabindex="0"> <table> <caption id="Cap1">Books I May or May Not Have Read</caption> <tr> <th>Author</th> <th>Title</th> <th>Year</th> <th>ISBN-13</th> <th>ISBN-10</th> </tr> <tr> <td>Miguel De Cervantes</td> <td>The Ingenious Gentleman Don Quixote of La Mancha</td> <td>1605</td> <td>9783125798502</td> <td>3125798507</td> </tr> […] <tr> <td>George Orwell</td> <td>Nineteen Eighty-Four</td> <td>1948</td> <td>9780451524935</td> <td>0451524934</td> </tr> </table> </div>
  • 16. Respond to Windows High Contrast Mode
  • 18. Rejiggering the Layout @media screen and (max-width: 37em), print and (max-width: 5in) { table, tr, td { display: block; } […] td { display: grid; grid-template-columns: 4em auto; grid-gap: 1em 0.5em; } }
  • 21.
  • 22. CSS Display Properties • The following override native semantics in the browser: • display: block • display: inline • display: grid • display: flex • display: contents • Nothing in the HTML / CSS specifications mandates this, • Does not work in reverse: • display: table • display: table-cell
  • 23. 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.
  • 24. Screen Reader (NVDA / Firefox)
  • 25. Screen Reader (NVDA / Firefox)
  • 26. Accessibility Tree • A sub-set of the DOM tree, • 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.
  • 31. ARIA to the Rescue? (Accessible Rich Internet Applications)
  • 32. ARIA Table Roles • You can use ARIA to re-insert the lost semantics: • <table role="table"> • <thead|tbody|tfoot role="rowgroup"> • <tr role="row"> • <td row="cell"> • <th scope="col" role="columnheader"> • <th scope="row" role="rowheader"> • Cannot address re-ordered content, • Cannot address hidden content.
  • 33. ARIA Table Roles • Do not use ARIA grid roles, • Test with a screen reader, • If your tables are generated from script, update the script.
  • 34. Table with ARIA <table id="Books" role="table"> <caption id="Cap1">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>
  • 35. Screen Reader (NVDA / Firefox)
  • 37. ARIA Grid • Do not use for simple data tables, • Intended to mimic Excel-style spreadsheet, • A grid is a composite widget so it: • Always contains multiple focusable elements, • Has only one focusable element in the page tab sequence, • Requires the author to provide code that manages focus movement inside it. • Ignoring for the purpose of this talk.
  • 38. How Is This a Thing?
  • 39. 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 their own heuristics for dealing with tables.
  • 40. Detecting AT Is Not Viable • Users 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 therefore impractical (and a terrible, terrible idea).
  • 41. CSS Is Not Blameless • CSS already impacts HTML semantics — display: none, • Using display: table does 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.
  • 42. ARIA Is Not Ideal • You must understand ARIA and the table structure, • This will require you to keep current on screen reader 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.
  • 43. 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.
  • 45. Specific to Tables • Only works with tables with tiny data, • Keyboard navigation can be confusing, • You have to re-rotate contents, • There may be some mirroring involved, • Generally not a good idea.
  • 46.
  • 48. 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.
  • 49. Why display: contents 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, • 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.
  • 55. Screen Reader (NVDA / Firefox)
  • 56. Bugs! • Firefox bug 1455357: Setting grid item to display:contents resets its accessible role • Chromium Issue 835455: Element not exposed to accessibility tree when it is set to display: contents • Safari bug 39630240 (which I cannot see because my AppleID may not have the needed permissions to see it) • CSSWG #2632: [css-display][css-aam][selectors-4] How elements with `display:contents` get focused?
  • 58. References • It’s OK to Use Tables • Hey, It’s Still OK to Use Tables • A Responsive Accessible Table • Tables, CSS Display Properties, and ARIA • Tables, JSON, CSS, ARIA, RWD, TLAs… • GitHub Contributions Chart • Short note on what CSS display properties do to table semantics by Steve Faulkner • Data Tables by Heydon Pickering • How display: contents; Works by Ire Aderinokun • CSS3 — Appendix B: Effects of display: contents on Unusual Elements
  • 59. CSS Display Properties versus HTML Semantics Presented at WordCamp Buffalo 2018 Slides will be posted at rosel.li/wcbuf

Hinweis der Redaktion

  1. HTML has a great native way to structure content.
  2. In HTML5 they are referred to as term/description lists. Description lists, dictionary lists, definition lists, damn lists, whatever.
  3. These list types work together or separately. We see them used for everything from navigation to panels in a carousel.
  4. HTML has a great way to present information in two axes.
  5. Coding them is easy, though it can be monotonous.
  6. A series of rows, consistently coded. A header. A caption.
  7. Sure, they can be a bit more complex, but that just adds some attributes.
  8. Generally spanning is a bad idea, but it has its place.
  9. Responsive design may have been the cause of some of this resistance to tables Lists have fared much better.
  10. Just let them be.
  11. Tables are the bane of the typical responsive developer. But there can be a much easier way.
  12. That’s it, just let it scroll. There are many cases where this is not ideal, but this is a good short term fix.
  13. Response is not just about viewport width Even if it were, a scrolling table may not cut it.
  14. Print is a media query, just like width, so support it.
  15. You likely will have to do nothing on a simple table. Unless you are using background colors or images.
  16. Perhaps you want to try a more novel way of adapting to a narrow width. You can just rearrange the table cells using CSS. CSS display properties just as block, grid, flex can all be powerful.
  17. I convert everything in the table to block to make layout easier, Dumps all the table, row, and cell styling, I use grid on the cells to make it easier to add the ‘headings’ inline.
  18. This is where things start to break
  19. CSS as implemented in browsers today can remove semantics, Conversely, you can not add it back with CSS
  20. Using NVDA with Firefox Hit T to get to the table Using Ctrl + Alt + arrow keys to navigate the table Announces column headings as I change columns Tells me when at the edge
  21. Using NVDA with Firefox Hitting T will not bring me to the table Using Ctrl + Alt + arrow keys will not work Does not announce column nor row count Does not tell me when I am at the edge
  22. Table before CSS display properties on the left Table after CSS display properties on the right Note how the entire accessibility tree is gone
  23. 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
  24. Th before CSS display properties on the left Th after CSS display properties on the right Not associated with the table No computed properties
  25. Td before CSS display properties on the left Td after CSS display properties on the right Not associated with the table No computed properties
  26. 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.
  27. Using NVDA with Firefox Hit T to get to the table Using Ctrl + Alt + arrow keys to navigate the table Announces column headings as I change columns Tells me when at the edge
  28. ARIA grids are a terrible idea and are not for data tables.
  29. 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
  30. Think about how it used for vertical centering
  31. Maybe not? Use this as a quick aside.
  32. Just a demo, the animation is there just to show what happens The tab order can be confusing A screen reader user will notice no difference No need for ARIA
  33. I am seeing this quickly become the new hotness. I want to call this one out specifically.
  34. Table before CSS display properties on the left Table after CSS display properties on the right Note how it is ignored in the accessibility tree The role does not bring it back
  35. ul before CSS display properties on the left ul after CSS display properties on the right Note how it is ignored in the accessibility tree The role does not bring it back
  36. button before CSS display properties on the left button after CSS display properties on the right Note how it is ignored in the accessibility tree The role does not bring it back
  37. h2 before CSS display properties on the left h2 after CSS display properties on the right Note how it is ignored in the accessibility tree The role does not bring it back
  38. Again, not a responsive