Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace aria-practices.html with a new content tree and move examples into the patterns branch of the tree #2417

Merged
merged 168 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
645e286
Create content directory structure and move all content out of exampl…
mcking65 Jul 24, 2022
14d066e
Add accordion pattern index.html
mcking65 Jul 24, 2022
b6b3b51
Adjust headings
mcking65 Jul 24, 2022
44aec91
Adjust example link href
mcking65 Jul 24, 2022
6e623fc
adjust href values in accordion example
mcking65 Jul 25, 2022
49d7c9a
Rename accordion pattern file
mcking65 Jul 25, 2022
9777f74
Adjust href of links to accordion pattern file
mcking65 Jul 25, 2022
1ebb85c
Add missing pattern directories
mcking65 Jul 25, 2022
08ff32f
Add alert pattern
mcking65 Jul 25, 2022
d0024b0
Add H2 headings for descriptions
mcking65 Jul 25, 2022
be1d75c
Add alert dialog pattern
mcking65 Jul 25, 2022
730b4b5
Add a stub pattern file for each pattern
mcking65 Jul 27, 2022
beafe9e
Rename accordion, alert, and alert dialog pattern files to put -patte…
mcking65 Jul 27, 2022
9b7ed6b
Update href of links to accordion pattern
mcking65 Jul 27, 2022
f34ba12
Add about h2
mcking65 Jul 27, 2022
d2c6734
Fix href for links to alert and alert dialog patterns
mcking65 Jul 27, 2022
ed01547
Move multithumb slider example from slider pattern to slider-multithu…
mcking65 Jul 27, 2022
d68f5de
Add breadcrumb pattern content
mcking65 Jul 30, 2022
3f392b4
Add button pattern content
mcking65 Jul 30, 2022
89f124d
Add content for carousel pattern
mcking65 Jul 31, 2022
c0ee119
Add checkbox pattern content
mcking65 Jul 31, 2022
25a7c73
Add combobox pattern content
mcking65 Jul 31, 2022
3e74870
Add modal dialog pattern content
mcking65 Jul 31, 2022
f58411a
Add section markup for about this pattern section and remove no-toc c…
mcking65 Jul 31, 2022
ea1679d
Add disclosure pattern content
mcking65 Jul 31, 2022
a96a844
Add feed pattern content
mcking65 Jul 31, 2022
d88c251
Add grid pattern content
mcking65 Jul 31, 2022
afa7007
Add link pattern content
mcking65 Jul 31, 2022
ff7d84e
Add listbox pattern content
mcking65 Jul 31, 2022
25eb07d
Rename breadcrumb example file from index to breadcrumb
mcking65 Jul 31, 2022
041e111
Update breadcrubm example
mcking65 Jul 31, 2022
c5d49c3
Update href of breadcrumb example link
mcking65 Jul 31, 2022
c599798
Put section tags around about this example section
mcking65 Jul 31, 2022
1e050e3
button example update with issue 2418
a11ydoer Aug 1, 2022
b249b60
carousel-1 pre-nav example update with issue 2418
a11ydoer Aug 1, 2022
f758b70
update carousel tab list example with issue 2418
a11ydoer Aug 1, 2022
6635198
updating two checkbox example code with issue 2418
a11ydoer Aug 1, 2022
c1ea149
update example file with issue 2418
a11ydoer Aug 1, 2022
d8bb191
update example with issue 2418 but js/utils.js file is missing
a11ydoer Aug 1, 2022
e9fde13
example udpate with issue 2814, dialog example is also missing ../js/…
a11ydoer Aug 1, 2022
32e82e1
updated the design pattern URL in datepicker dialog example file
a11ydoer Aug 1, 2022
9f53926
update disclosure example with issue 2418
a11ydoer Aug 1, 2022
50f4168
update feed example with issue 2418
a11ydoer Aug 1, 2022
cf37083
update feedDisplay example, added h2 and section temporarily, need to…
a11ydoer Aug 1, 2022
3ad17d9
update the feed example with issue 2418
a11ydoer Aug 1, 2022
0797a17
update grid pattern examples with issue 2418
a11ydoer Aug 1, 2022
6af670a
update link pattern examples with issue 2418
a11ydoer Aug 1, 2022
3c1e0be
update 4 listbox pattern examples with issue 2418
a11ydoer Aug 1, 2022
71c276e
update 3 menu button pattern examples with issue 2418
a11ydoer Aug 1, 2022
b237820
update 2 menu and menubar pattern examples with issue 2418
a11ydoer Aug 1, 2022
002e5bc
update meter pattern example file with issue 2418
a11ydoer Aug 1, 2022
587e79d
update radio group pattern example file with issue 2418
a11ydoer Aug 1, 2022
431b702
removed apg 1.2 from title tag
a11ydoer Aug 2, 2022
7529646
updated the link for the button pattern
a11ydoer Aug 2, 2022
80ccdfb
updated the slider pattern example files with issue 2418
a11ydoer Aug 2, 2022
202e4e8
updated cross references to slider examples(slider and slider-multith…
a11ydoer Aug 2, 2022
7c9b08a
remove empty line before closing of main tag
a11ydoer Aug 2, 2022
d7f9c1f
update datepicker spinbuttons file with issue 2418 list
a11ydoer Aug 2, 2022
8651677
updated similar example links in spinbutton example file
a11ydoer Aug 2, 2022
7e21271
update switch example files with issue 2418 list
a11ydoer Aug 2, 2022
29b1b9e
update table pattern example files with issue 2418 list
a11ydoer Aug 2, 2022
4585dfe
update tabs pattern example files with issue 2418 list
a11ydoer Aug 2, 2022
88a435b
update toolbar pattern example files with issue 2418 list
a11ydoer Aug 2, 2022
70daff2
update multiple cross reference to treeview examples and treegrid pat…
a11ydoer Aug 2, 2022
71bcfdc
update treeview pattern example files with issue 2418 list
a11ydoer Aug 2, 2022
da92a32
Implement 2418 task 6
alflennik Aug 18, 2022
c5b8056
Address PR 2441 feedback
alflennik Aug 23, 2022
d9c8694
Implement 2418 task 10
alflennik Sep 1, 2022
5ca99e7
Add menubar pattern content
mcking65 Sep 5, 2022
85aab94
Add menu button pattern content
mcking65 Sep 5, 2022
c19da95
Add meter pattern content
mcking65 Sep 5, 2022
7e1cb21
Add radio group pattern content
mcking65 Sep 5, 2022
1dff33b
Add slider pattern content and fix radio heading levels
mcking65 Sep 5, 2022
6fc5307
Add multi-thumb slider pattern content
mcking65 Sep 5, 2022
6b32ae6
Add spinbutton pattern content
mcking65 Sep 5, 2022
e7eeaee
Add switch pattern content
mcking65 Sep 5, 2022
b4ef34f
Add table pattern content
mcking65 Sep 5, 2022
1bc8afb
Add tabs pattern content
mcking65 Sep 5, 2022
789a6f0
Add toolbar pattern content
mcking65 Sep 6, 2022
791161f
Add tooltip pattern content
mcking65 Sep 6, 2022
64de8c0
Add treeview pattern content
mcking65 Sep 6, 2022
b60f241
Add treegrid pattern content
mcking65 Sep 6, 2022
156b9f0
Add window splitter pattern content
mcking65 Sep 6, 2022
5e05450
Remove patterns from aria-practices.html
mcking65 Sep 6, 2022
39b2a6d
Fix missing opening title tag in table pattern
mcking65 Sep 6, 2022
a186c8d
Remove aria-practices-DeletedSectionsArchive.html
mcking65 Sep 6, 2022
162c743
Infrastructure: update globs for file moves (#2467)
nschonni Sep 6, 2022
22a3086
Merge pull request #2464 from w3c/move-examples-10
alflennik Sep 7, 2022
a203048
Merge branch 'main' into move-examples-6
alflennik Sep 22, 2022
e9e5b41
Address PR 2441 feedback
alflennik Sep 22, 2022
8189a95
Merge branch 'move-examples' into move-examples-6
alflennik Sep 22, 2022
e626b56
Merge pull request #2441 from w3c/move-examples-6
alflennik Sep 22, 2022
910362f
Revise index generation to use new content tree (Issue 2418 task 8) (…
alflennik Sep 23, 2022
b5afdfe
Move practices from aria-practices.html to new content tree (#2479)
mcking65 Sep 25, 2022
ad54942
Remove index section from aria-practices.html
mcking65 Sep 25, 2022
4d66a99
Restore Home page index.html to root of content tree
mcking65 Sep 27, 2022
2751872
Fix links to practices and patterns (pull #2483)
mcking65 Sep 28, 2022
d58ab5f
Fix link text in pattern and example files
mcking65 Sep 28, 2022
c7e594f
Remove class notoc
mcking65 Sep 28, 2022
a9e6340
Add missing keyboard_interaction section IDs to patterns
mcking65 Sep 28, 2022
baddbec
Add missing roles_states_properties IDs to patterns
mcking65 Sep 28, 2022
116c79b
Fix inconsistent IDs and broken links to keyboard and roles, states, …
mcking65 Sep 28, 2022
42ea301
Rearrangeable Listbox Example: Add note on APG vs. browser multiselec…
smhigley Oct 2, 2022
dccfe2e
Complete consistency pass over source code
alflennik Oct 4, 2022
b37c8e0
Ensure consistent self-closing tag formatting
alflennik Oct 4, 2022
43988fc
Revert erroneously changed content index file
alflennik Oct 4, 2022
7ee334d
Ensure consistent self-closing tag formatting
alflennik Oct 4, 2022
67f0c02
Fix dependency of data grid examples on explicitly loaded util script
alflennik Oct 4, 2022
73c01b4
Merge branch 'move-examples' into move-examples-consistency
alflennik Oct 4, 2022
12d5fce
Regression test fixes following example script changes
alflennik Oct 4, 2022
bda80ed
Add utils script to all examples
alflennik Oct 4, 2022
10a52ec
Regression test fixes following example script changes
alflennik Oct 4, 2022
f07bed9
Resolve additional example inconsistencies
alflennik Oct 4, 2022
e50a300
Address issue 2488
alflennik Oct 5, 2022
4850cac
Address feedback on PR 2499
alflennik Oct 6, 2022
a110453
Merge branch 'move-examples-consistency' into move-examples-alert-dialog
alflennik Oct 6, 2022
c869793
Update alert-dialog in example index
alflennik Oct 6, 2022
bfe2ecc
Place long anchor tags on their own lines
alflennik Oct 7, 2022
2a4f2ff
Merge branch 'move-examples-consistency' into move-examples-alert-dialog
alflennik Oct 7, 2022
4862c99
Address PR 2502 feedback move alertdialog
alflennik Oct 20, 2022
e650074
Switch Example using Button: Fix white on white bug (Pull #2482)
jongund Oct 4, 2022
b54ef15
Consistency pass over source code (Issue 2418 Task) (#2499)
alflennik Oct 24, 2022
3b77fad
Merge branch 'move-examples' into move-examples-alert-dialog
alflennik Oct 26, 2022
820360b
Merge pull request #2502 from w3c/move-examples-alert-dialog
alflennik Oct 26, 2022
5c5f372
Update coverage report script to process new content tree and put out…
alflennik Oct 27, 2022
07859e9
Unnest treeview examples for consistency (issue 2418 task) (pull #2517)
alflennik Oct 27, 2022
c148931
Run reference-tables.js and coverage-reports.js
mcking65 Oct 27, 2022
ffb2164
Create about and read-first files
mcking65 Oct 31, 2022
36614b8
delete content from aria-practices.html
mcking65 Oct 31, 2022
f1f3954
Add acknowledgements and references to about page
mcking65 Oct 31, 2022
fe6507b
Add names to cspell config
mcking65 Nov 1, 2022
9b37c57
Add more names to spelling config
mcking65 Nov 1, 2022
8e242ae
Sort words array in cspell config
mcking65 Nov 1, 2022
ea73dc3
Fix hrefs in examples notice.html
mcking65 Nov 1, 2022
f417aa5
Update copy in notice.html to match copy used in production
mcking65 Nov 1, 2022
dcc2bba
Fix notes in button and combobox patterns
mcking65 Nov 2, 2022
e1ed080
Fix slider warning
mcking65 Nov 2, 2022
8a1234e
updated markup for notes
jongund Nov 2, 2022
0d63ee3
udpated warning markup
jongund Nov 2, 2022
e7adbe6
Merge pull request #2521 from w3c/move-about
alflennik Nov 9, 2022
49e8c74
Implement fixes for task 11 of issue 2417
alflennik Nov 10, 2022
2141c2c
Apply checkbox fixes from PR 2518
alflennik Nov 10, 2022
4cc3623
Support spec links without Respec
alflennik Nov 11, 2022
dcab965
Make spec link fixer usable in node scripts
alflennik Nov 11, 2022
ef77670
Make spec link fixer usable in node scripts pt 2
alflennik Nov 11, 2022
8219af3
Fix spelling failure
alflennik Nov 11, 2022
ea10955
Editorial revision to checkbox description
mcking65 Nov 11, 2022
e41a28f
Editorial revision to intro of grid and table properties practice
mcking65 Nov 11, 2022
a7d1de8
Fix broken links
alflennik Nov 16, 2022
4f7f89b
Merge branch 'move-examples-build-fixes' of https://github.com/w3c/ar…
alflennik Nov 16, 2022
88a10f6
Implement link checker
alflennik Nov 16, 2022
f41e6bb
Trigger link-checker
alflennik Nov 16, 2022
67b96e5
Polish link-checker workflow
alflennik Nov 16, 2022
2b6a26b
Address PR 2537 feedback
alflennik Nov 16, 2022
72c91b6
Merge branch 'move-examples-build-fixes' into link-checker
alflennik Nov 16, 2022
7fc172f
Add PR 2543 support for updated PR 2537
alflennik Nov 16, 2022
c4f3bbe
Fix garbled text on about page
alflennik Nov 17, 2022
d5bb510
Query string working with wai-aria-practices link rewrites
alflennik Nov 17, 2022
82c2831
Merge pull request #2532 from w3c/notes-and-warnings
alflennik Nov 17, 2022
432dad7
Merge branch 'move-examples' into move-examples-build-fixes
alflennik Nov 17, 2022
ac1e84b
Make warnings, notes and advisements consistent
alflennik Nov 17, 2022
a3a2d04
Address PR 2537 feedback support h5s in class=note
alflennik Nov 22, 2022
8a603a2
Merge pull request #2537 from w3c/move-examples-build-fixes
alflennik Nov 22, 2022
bb45ea4
Merge pull request #2543 from w3c/link-checker
alflennik Nov 22, 2022
fffe694
Address PR 2417 feedback code block spacing
alflennik Dec 1, 2022
d233151
Merge branch 'main' into move-examples
alflennik Dec 1, 2022
be777d0
Comment out flaky test
alflennik Dec 1, 2022
feaee5b
Update landmark index link see issue 172
alflennik Dec 6, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
118 changes: 118 additions & 0 deletions content/patterns/accordion/accordion-pattern.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Accordion Pattern</title>
</head>
<body>
<h1>Accordion Pattern (Sections With Show/Hide Functionality)</h1>

<section>
<h2>About This Pattern</h2>
<p>
An accordion is a vertically stacked set of interactive headings that each contain a title, content snippet, or thumbnail representing a section of content.
The headings function as controls that enable users to reveal or hide their associated sections of content.
Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page.
</p>
<p>Terms for understanding accordions include:</p>
<dl>
<dt>Accordion Header:</dt>
<dd>Label for or thumbnail representing a section of content that also serves as a control for showing, and in some implementations, hiding the section of content. </dd>
<dt>Accordion Panel:</dt>
<dd>Section of content associated with an accordion header.</dd>
</dl>
<p>
In some accordions, there are additional elements that are always visible adjacent to the accordion header.
For instance, a menubutton may accompany each accordion header to provide access to actions that apply to that section.
And, in some cases, a snippet of the hidden content may also be visually persistent.
</p>
</section>

<section>
<h2>Example</h2>
<p><a href="examples/accordion.html">Accordion Example</a>: demonstrates a form divided into three sections using an accordion to show one section at a time. </p>
</section>

<section>
<h2>Keyboard Interaction</h2>
<ul>
<li>
<kbd>Enter</kbd> or <kbd>Space</kbd>:
<ul>
<li>
When focus is on the accordion header for a collapsed panel, expands the associated panel.
If the implementation allows only one panel to be expanded, and if another panel is expanded, collapses that panel.
</li>
<li>
When focus is on the accordion header for an expanded panel, collapses the panel if the implementation supports collapsing.
Some implementations require one panel to be expanded at all times and allow only one panel to be expanded; so, they do not support a collapse function.
</li>
</ul>
</li>
<li><kbd>Tab</kbd>: Moves focus to the next focusable element; all focusable elements in the accordion are included in the page <kbd>Tab</kbd> sequence.</li>
<li><kbd>Shift + Tab</kbd>: Moves focus to the previous focusable element; all focusable elements in the accordion are included in the page <kbd>Tab</kbd> sequence.</li>
<li>
<kbd>Down Arrow</kbd> (Optional): If focus is on an accordion header, moves focus to the next accordion header.
If focus is on the last accordion header, either does nothing or moves focus to the first accordion header.
</li>
<li>
<kbd>Up Arrow</kbd> (Optional): If focus is on an accordion header, moves focus to the previous accordion header.
If focus is on the first accordion header, either does nothing or moves focus to the last accordion header.
</li>
<li>
<kbd>Home</kbd> (Optional): When focus is on an accordion header, moves focus to the first accordion header.
</li>
<li>
<kbd>End</kbd> (Optional): When focus is on an accordion header, moves focus to the last accordion header.
</li>
</ul>
</section>

<section>
<h2>WAI-ARIA Roles, States, and Properties:</h2>
<ul>
<li>
The title of each accordion header is contained in an element with role <a href="#button" class="role-reference">button</a>.
</li>
<li>
Each accordion header <code>button</code> is wrapped in an element with role <a href="#heading" class="role-reference">heading</a> that has a value set for <a href="#aria-level" class="property-reference">aria-level</a> that is appropriate for the information architecture of the page.
<ul>
<li>If the native host language has an element with an implicit <code>heading</code> and <code>aria-level</code>, such as an HTML heading tag, a native host language element may be used.</li>
<li>
The <code>button</code> element is the only element inside the <code>heading</code> element.
That is, if there are other visually persistent elements, they are not included inside the <code>heading</code> element.
</li>
</ul>
</li>
<li>
If the accordion panel associated with an accordion header is visible, the header <code>button</code> element has <a href="#aria-expanded" class="state-reference">aria-expanded</a> set to <code>true</code>.
If the panel is not visible, <a href="#aria-expanded" class="state-reference">aria-expanded</a> is set to <code>false</code>.
</li>
<li>
The accordion header <code>button</code> element has <a href="#aria-controls" class="property-reference">aria-controls</a> set to the ID of the element containing the accordion panel content.
</li>
<li>
If the accordion panel associated with an accordion header is visible, and if the accordion does not permit the panel to be collapsed, the header <code>button</code> element has <a href="#aria-disabled" class="state-reference">aria-disabled</a> set to <code>true</code>.
</li>
<li>
Optionally, each element that serves as a container for panel content has role
<a href="#region" class="role-reference">region</a> and
<a href="#aria-labelledby" class="property-reference">aria-labelledby</a>
with a value that refers to the button that controls display of the panel.
<ul>
<li>
Avoid using the <code>region</code> role in circumstances that create landmark region proliferation,
e.g., in an accordion that contains more than approximately 6 panels that can be expanded at the same time.
</li>
<li>
Role <code>region</code> is especially helpful to the perception of structure by screen reader users when panels contain heading elements or a nested accordion.
</li>
</ul>
</li>
</ul>
</section>


</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Accordion Example | WAI-ARIA Authoring Practices 1.2</title>
<title>Accordion Example</title>
<!-- Core js and css shared by all examples; do not modify when using this template. -->
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/base.css">
<link rel="stylesheet" href="../css/core.css">
<script src="../js/examples.js"></script>
<script src="../js/highlight.pack.js"></script>
<script src="../js/app.js"></script>
<link rel="stylesheet" href="../../../shared/css/core.css">
<script src="../../../shared/js/examples.js"></script>
<script src="../../../shared/js/highlight.pack.js"></script>
<script src="../../../shared/js/app.js"></script>

<!-- js and css for this example. -->
<link rel="stylesheet" type="text/css" href="css/accordion.css">
Expand All @@ -18,19 +18,22 @@
<body>
<nav aria-label="Related Links" class="feedback">
<ul>
<li><a href="../../#browser_and_AT_support">Browser and Assistive Technology Support</a></li>
<li><a href="https://github.com/w3c/aria-practices/issues/new">Report Issue</a></li>
<li><a href="https://github.com/w3c/aria-practices/projects/8">Related Issues</a></li>
<li><a href="../../#accordion">Design Pattern</a></li>
<li><a href="../accordion-pattern.html">Design Pattern</a></li>
</ul>
</nav>
<main>
<h1>Accordion Example</h1>
<p>
The below example section contains a simple personal information input form divided into 3 sections
that demonstrates the
<a href="../../#accordion">design pattern for accordion</a>.
</p>

<section>
<h2>About This Example</h2>
<p>
The below example section contains a simple personal information input form divided into 3 sections
that demonstrates the
<a href="../accordion-pattern.html">design pattern for accordion</a>.
</p>
</section>

<section>
<div class="example-header">
<h2 id="ex_label">Example</h2>
Expand Down Expand Up @@ -276,9 +279,6 @@ <h2 id="sc1_label">HTML Source Code</h2>
</section>

</main>
<nav>
<a href="../../#accordion">Accordion Design Pattern in WAI-ARIA Authoring Practices 1.2</a>
</nav>
<script src="js/accordion.js"></script>
</body>
</html>
65 changes: 65 additions & 0 deletions content/patterns/alert-dialog/alert-dialog-pattern.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Alert and Message Dialogs Pattern</title>
</head>
<body>
<h1>Alert and Message Dialogs Pattern</h1>

<section>
<h2>About This Pattern</h2>
<p>
An alert dialog is a <a href="../dialog-modal/dialog-modal-pattern.html">modal dialog</a> that interrupts the user's workflow to communicate an important message and acquire a response.
Examples include action confirmation prompts and error message confirmations.
The <a href="#alertdialog" class="role-reference">alertdialog</a> role
enables assistive technologies and browsers to distinguish alert dialogs from other dialogs
so they have the option of giving alert dialogs special treatment, such as playing a system alert sound.
</p>
</section>

<section>
<h2>Example</h2>
<p><a href="../dialog-modal/examples/alertdialog.html">Alert Dialog Example</a>: A confirmation prompt that demonstrates an alert dialog.</p>
</section>

<section>
<h2>Keyboard Interaction</h2>
<p>See the keyboard interaction section for the <a href="../dialog-modal/dialog-modal-pattern.html">modal dialog pattern</a>.</p>
</section>

<section>
<h2>WAI-ARIA Roles, States, and Properties</h2>
<ul>
<li>
The element that contains all elements of the dialog, including the alert
message and any dialog buttons, has role
<a class="role-reference" href="#alertdialog">alertdialog</a>.
</li>
<li>
The element with role <code>alertdialog</code> has either:
<ul>
<li>
A value for
<a href="#aria-labelledby" class="property-reference">aria-labelledby</a>
that refers to the element containing the title of the dialog if the
dialog has a visible label.
</li>
<li>
A value for
<a href="#aria-label" class="property-reference">aria-label</a>
if the dialog does not have a visible label.
</li>
</ul>
</li>
<li>
The element with role <code>alertdialog</code> has a value set for
<a href="#aria-describedby" class="property-reference">aria-describedby</a>
that refers to the element containing the alert message.
</li>
</ul>
</section>

</body>
</html>
50 changes: 50 additions & 0 deletions content/patterns/alert/alert-pattern.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Alert Pattern</title>
</head>
<body>
<h1>Alert Pattern</h1>

<section>
<h2>About This Pattern</h2>
<p>
An <a class="role-reference" href="#alert">alert</a> is an element that displays a brief, important message in a way that attracts the user's attention without interrupting the user's task.
Dynamically rendered alerts are automatically announced by most screen readers, and in some operating systems, they may trigger an alert sound.
It is important to note that, at this time, screen readers do not inform users of alerts that are present on the page before page load completes.
</p>
<p>
Because alerts are intended to provide important and potentially time-sensitive information without interfering with the user's ability to continue working,
it is crucial they do not affect keyboard focus.
The <a href="../alert-dialog/pattern-alert-dialog.html">alert dialog</a> is designed for situations where interrupting work flow is necessary.
</p>
<p>
It is also important to avoid designing alerts that disappear automatically.
An alert that disappears too quickly can lead to failure to meet
<a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/time-limits-no-exceptions.html">WCAG 2.0 success criterion 2.2.3</a>.
Another critical design consideration is the frequency of interruption caused by alerts.
Frequent interruptions inhibit usability for people with visual and cognitive disabilities, which makes meeting the requirements of
<a href="https://www.w3.org/TR/UNDERSTANDING-WCAG20/time-limits-postponed.html">WCAG 2.0 success criterion 2.2.4</a>
more difficult.
</p>
</section>

<section>
<h2>Example</h2>
<p><a href="examples/alert.html">Alert Example</a></p>
</section>

<section>
<h2>Keyboard Interaction</h2>
<p>Not applicable.</p>
</section>

<section>
<h2>WAI-ARIA Roles, States, and Properties</h2>
<p>The widget has a role of <a class="role-reference" href="#alert">alert</a>.</p>
</section>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,41 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Alert Example | WAI-ARIA Authoring Practices 1.2</title>
<title>Alert Example</title>

<!-- Core js and css shared by all examples; do not modify when using this template. -->
<link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/2016/base.css">
<link rel="stylesheet" href="../css/core.css">
<script src="../js/examples.js"></script>
<script src="../js/highlight.pack.js"></script>
<script src="../js/app.js"></script>
<link rel="stylesheet" href="../../../shared/css/core.css">
<script src="../../../shared/js/examples.js"></script>
<script src="../../../shared/js/highlight.pack.js"></script>
<script src="../../../shared/js/app.js"></script>

<!-- js and css for this example. -->
<link href="css/alert.css" rel="stylesheet">
<script src="js/alert.js" type="text/javascript"></script>
</head>
<body>
<nav aria-label="Related Links" class="feedback">
<ul>
<li><a href="../../#browser_and_AT_support">Browser and Assistive Technology Support</a></li>
<li><a href="https://github.com/w3c/aria-practices/issues/new">Report Issue</a></li>
<li><a href="https://github.com/w3c/aria-practices/projects/20">Related Issues</a></li>
<li><a href="../../#alert">Design Pattern</a></li>
</ul>
</nav>
<nav aria-label="Related Links" class="feedback">
<ul>
<li><a href="https://github.com/w3c/aria-practices/projects/20">Related Issues</a></li>
<li><a href="../alert-pattern.html">Design Pattern</a></li>
</ul>
</nav>
<main>
<h1>Alert Example</h1>
<p>
The below example demonstrates the <a href="../../#alert">design pattern for alert</a>.
Activating the <q>Trigger Alert</q> button causes a message to be inserted into the example alert element.
</p>
<p>Similar examples include:</p>
<ul>
<li><a href="../dialog-modal/alertdialog.html">Alert Dialog Example</a>: A confirmation prompt that demonstrates an alert dialog.</li>
</ul>

<section>
<h2>About This Example</h2>
<p>
The below example demonstrates the <a href="../alert-pattern.html">design pattern for alert</a>.
Activating the <q>Trigger Alert</q> button causes a message to be inserted into the example alert element.
</p>
<p>Similar examples include:</p>
<ul>
<li><a href="../../dialog-modal/examples/alertdialog.html">Alert Dialog Example</a>: A confirmation prompt that demonstrates an alert dialog.</li>
</ul>
</section>

<section>
<div class="example-header">
<h2 id="ex_label">Example</h2>
Expand Down Expand Up @@ -138,8 +141,5 @@ <h2 id="sc1_label">HTML Source Code</h2>
</script>
</section>
</main>
<nav>
<a href="../../#alert">Alert Design Pattern in WAI-ARIA Authoring Practices 1.2</a>
</nav>
</body>
</html>
</html>
File renamed without changes.
Loading