Skip to content

Commit

Permalink
Redundant role="navigation" on <nav>s
Browse files Browse the repository at this point in the history
plus one example that still used the old <div role="navigation"> and a
fix-up of the callout as per
#15109
  • Loading branch information
patrickhlauke committed Nov 14, 2014
1 parent 25cac1e commit bab3622
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 34 deletions.
34 changes: 17 additions & 17 deletions docs/_includes/components/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ <h4>Changing the collapsed mobile navbar breakpoint</h4>
</div>
<div class="bs-callout bs-callout-warning" id="callout-navbar-role">
<h4>Make navbars accessible</h4>
<p>Be sure to add a <code>role="navigation"</code> to every navbar to help with accessibility.</p>
<p>Be sure to use a <code>&lt;nav&gt;</code> element or, if using a more generic element such as a <code>&lt;div&gt;</code>, add a <code>role="navigation"</code> to every navbar to explicitly identify it as a landmark region for users of assistive technologies.</p>

This comment has been minimized.

Copy link
@rs459

rs459 Feb 12, 2015

If you remove role="navigation" you lost the landmark inside assistive technology even with nav :
🆗 Jaws is ok
🚫 NVDA says nothing
🚫 Voice-over says nothing

This comment has been minimized.

Copy link
@patrickhlauke

patrickhlauke Feb 12, 2015

Author Member

Interesting. I was aware that there's a bug with IE/NVDA (but if you use Chrome or Firefox with NVDA, the <nav> is correctly identified as a landmark.

nav

As for VoiceOver (assuming OS X), it seems this is a recent change in behavior/bug, as it previously worked fine (see also http://stevefaulkner.github.io/html-mapping-tests/).

As in both cases this seems related to shortcomings/bugs in AT, and since (from experience and talking to AT users) landmark-based navigation is still not prevalent for these users (mainly because many sites don't use landmarks yet, so a chicken/egg situation), I may opt to leave this change as is...

However, thanks for making me go and recheck VO (and find out that it seems to have borked itself in recent updates)

[EDIT] It also seems that VO/iOS behaves correctly and recognises <nav> as a landmark, so it's definitely a new VO/OS X bug

</div>

<div class="bs-example">
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
Expand Down Expand Up @@ -84,7 +84,7 @@ <h4>Make navbars accessible</h4>
</nav>
</div>
{% highlight html %}
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
Expand Down Expand Up @@ -143,7 +143,7 @@ <h4>Make navbars accessible</h4>
<h2 id="navbar-brand-image">Brand image</h2>
<p>Replace the navbar brand with your own image by swapping the text for an <code>&lt;img&gt;</code>. Since the <code>.navbar-brand</code> has its own padding and height, you may need to override some CSS depending on your image.</p>
<div class="bs-example">
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">
Expand All @@ -154,7 +154,7 @@ <h2 id="navbar-brand-image">Brand image</h2>
</nav>
</div>
{% highlight html %}
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">
Expand All @@ -170,7 +170,7 @@ <h2 id="navbar-forms">Forms</h2>
<p>Place form content within <code>.navbar-form</code> for proper vertical alignment and collapsed behavior in narrow viewports. Use the alignment options to decide where it resides within the navbar content.</p>
<p>As a heads up, <code>.navbar-form</code> shares much of its code with <code>.form-inline</code> via mixin. <strong class="text-danger">Some form controls, like input groups, may require fixed widths to be show up properly within a navbar.</strong></p>
<div class="bs-example">
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-2">
Expand Down Expand Up @@ -215,7 +215,7 @@ <h4>Always add labels</h4>
<h2 id="navbar-buttons">Buttons</h2>
<p>Add the <code>.navbar-btn</code> class to <code>&lt;button&gt;</code> elements not residing in a <code>&lt;form&gt;</code> to vertically center them in the navbar.</p>
<div class="bs-example">
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-3">
Expand Down Expand Up @@ -244,7 +244,7 @@ <h4>Context-specific usage</h4>
<h2 id="navbar-text">Text</h2>
<p>Wrap strings of text in an element with <code>.navbar-text</code>, usually on a <code>&lt;p&gt;</code> tag for proper leading and color.</p>
<div class="bs-example">
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-4">
Expand All @@ -269,7 +269,7 @@ <h2 id="navbar-text">Text</h2>
<h2 id="navbar-links">Non-nav links</h2>
<p>For folks using standard links that are not within the regular navbar navigation component, use the <code>.navbar-link</code> class to add the proper colors for the default and inverse navbar options.</p>
<div class="bs-example">
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-5">
Expand Down Expand Up @@ -304,7 +304,7 @@ <h4>Right aligning multiple components</h4>
<h2 id="navbar-fixed-top">Fixed to top</h2>
<p>Add <code>.navbar-fixed-top</code> and include a <code>.container</code> or <code>.container-fluid</code> to center and pad navbar content.</p>
<div class="bs-example bs-navbar-top-example">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<nav class="navbar navbar-default navbar-fixed-top">
<!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. -->
<div class="container-fluid">
<div class="navbar-header">
Expand All @@ -328,7 +328,7 @@ <h2 id="navbar-fixed-top">Fixed to top</h2>
</nav>
</div><!-- /example -->
{% highlight html %}
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
...
</div>
Expand All @@ -348,7 +348,7 @@ <h4>Body padding required</h4>
<h2 id="navbar-fixed-bottom">Fixed to bottom</h2>
<p>Add <code>.navbar-fixed-bottom</code> and include a <code>.container</code> or <code>.container-fluid</code> to center and pad navbar content.</p>
<div class="bs-example bs-navbar-bottom-example">
<nav class="navbar navbar-default navbar-fixed-bottom" role="navigation">
<nav class="navbar navbar-default navbar-fixed-bottom">
<!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. -->
<div class="container-fluid">
<div class="navbar-header">
Expand All @@ -372,7 +372,7 @@ <h2 id="navbar-fixed-bottom">Fixed to bottom</h2>
</nav>
</div><!-- /example -->
{% highlight html %}
<nav class="navbar navbar-default navbar-fixed-bottom" role="navigation">
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
...
</div>
Expand All @@ -393,7 +393,7 @@ <h2 id="navbar-static-top">Static top</h2>
<p>Create a full-width navbar that scrolls away with the page by adding <code>.navbar-static-top</code> and include a <code>.container</code> or <code>.container-fluid</code> to center and pad navbar content.</p>
<p>Unlike the <code>.navbar-fixed-*</code> classes, you do not need to change any padding on the <code>body</code>.</p>
<div class="bs-example bs-navbar-top-example">
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<nav class="navbar navbar-default navbar-static-top">
<!-- We use the fluid option here to avoid overriding the fixed width of a normal container within the narrow content columns. -->
<div class="container-fluid">
<div class="navbar-header">
Expand All @@ -418,7 +418,7 @@ <h2 id="navbar-static-top">Static top</h2>
</nav>
</div><!-- /example -->
{% highlight html %}
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
...
</div>
Expand All @@ -429,7 +429,7 @@ <h2 id="navbar-static-top">Static top</h2>
<h2 id="navbar-inverted">Inverted navbar</h2>
<p>Modify the look of the navbar by adding <code>.navbar-inverse</code>.</p>
<div class="bs-example">
<nav class="navbar navbar-inverse" role="navigation">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
Expand All @@ -454,7 +454,7 @@ <h2 id="navbar-inverted">Inverted navbar</h2>
</nav>
</div><!-- /example -->
{% highlight html %}
<nav class="navbar navbar-inverse" role="navigation">
<nav class="navbar navbar-inverse">
...
</nav>
{% endhighlight %}
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/js/dropdowns.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h2 id="dropdowns-examples">Examples</h2>

<h3>Within a navbar</h3>
<div class="bs-example">
<nav id="navbar-example" class="navbar navbar-default navbar-static" role="navigation">
<nav id="navbar-example" class="navbar navbar-default navbar-static">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-example-js-navbar-collapse">
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/js/scrollspy.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h1 id="scrollspy" class="page-header">ScrollSpy <small>scrollspy.js</small></h1
<h2 id="scrollspy-examples">Example in navbar</h2>
<p>The ScrollSpy plugin is for automatically updating nav targets based on scroll position. Scroll the area below the navbar and watch the active class change. The dropdown sub items will be highlighted as well.</p>
<div class="bs-example">
<nav id="navbar-example2" class="navbar navbar-default navbar-static" role="navigation">
<nav id="navbar-example2" class="navbar navbar-default navbar-static">
<div class="container-fluid">
<div class="navbar-header">
<button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target=".bs-example-js-navbar-scrollspy">
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/nav/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</button>
<a href="../" class="navbar-brand">Bootstrap</a>
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<nav class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li{% if page.slug == "getting-started" %} class="active"{% endif %}>
<a href="../getting-started/">Getting started</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/carousel/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="navbar-wrapper">
<div class="container">

<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<body>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/jumbotron/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<body>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/justified-nav/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<div class="masthead">
<h3 class="text-muted">Project name</h3>
<div role="navigation">
<nav>
<ul class="nav nav-justified">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Projects</a></li>
Expand All @@ -42,7 +42,7 @@ <h3 class="text-muted">Project name</h3>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</nav>
</div>

<!-- Jumbotron -->
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/navbar-fixed-top/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<body>

<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/navbar-static-top/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<body>

<!-- Static navbar -->
<nav class="navbar navbar-default navbar-static-top" role="navigation">
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/navbar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="container">

<!-- Static navbar -->
<nav class="navbar navbar-default" role="navigation">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/non-responsive/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<body>

<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/offcanvas/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</head>

<body>
<nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
<nav class="navbar navbar-fixed-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down Expand Up @@ -95,7 +95,7 @@ <h2>Heading</h2>
</div><!--/row-->
</div><!--/.col-xs-12.col-sm-9-->

<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar" role="navigation">
<div class="col-xs-6 col-sm-3 sidebar-offcanvas" id="sidebar">
<div class="list-group">
<a href="#" class="list-group-item active">Link</a>
<a href="#" class="list-group-item">Link</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/starter-template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<body>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/sticky-footer-navbar/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<body>

<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<body role="document">

<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
Expand Down

0 comments on commit bab3622

Please sign in to comment.