Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
fix(dialog): Move aria roles from dialog root to dialog surface… (#5239)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyzhong authored Nov 11, 2019
1 parent afe0dd1 commit c704b71
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 69 deletions.
36 changes: 18 additions & 18 deletions packages/mdc-dialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ npm install @material/dialog
### HTML Structure

```html
<div class="mdc-dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<div class="mdc-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<!-- Title cannot contain leading whitespace due to mdc-typography-baseline-top() -->
<h2 class="mdc-dialog__title" id="my-dialog-title"><!--
-->Dialog Title<!--
Expand Down Expand Up @@ -114,13 +114,13 @@ dialog.listen('MDCDialog:opened', () => {
The Simple Dialog contains a list of potential actions. It does not contain buttons.

```html
<div class="mdc-dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<div class="mdc-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<!-- Title cannot contain leading whitespace due to mdc-typography-baseline-top() -->
<h2 class="mdc-dialog__title" id="my-dialog-title"><!--
-->Choose a Ringtone<!--
Expand Down Expand Up @@ -150,13 +150,13 @@ The Confirmation Dialog contains a list of choices, and buttons to confirm or ca
radio buttons (indicating single selection) or checkboxes (indicating multiple selection).

```html
<div class="mdc-dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<div class="mdc-dialog">
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="my-dialog-title"
aria-describedby="my-dialog-content">
<!-- Title cannot contain leading whitespace due to mdc-typography-baseline-top() -->
<h2 class="mdc-dialog__title" id="my-dialog-title"><!--
-->Choose a Ringtone<!--
Expand Down
10 changes: 5 additions & 5 deletions test/screenshot/spec/mdc-dialog/mixins/container-fill-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--container-fill-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
10 changes: 5 additions & 5 deletions test/screenshot/spec/mdc-dialog/mixins/content-ink-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--content-ink-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
10 changes: 5 additions & 5 deletions test/screenshot/spec/mdc-dialog/mixins/max-height.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--max-height"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/max-width.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--max-width"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--5-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/min-width.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--min-width"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title" id="test-dialog__title">Title</h2>
<div class="mdc-dialog__content test-dialog__content" id="test-dialog__content">
<div class="test-dialog__content-rect">
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/scrim-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--scrim-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/scroll-divider-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--scroll-divider-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/shape-radius.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--shape-radius"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down
12 changes: 6 additions & 6 deletions test/screenshot/spec/mdc-dialog/mixins/title-ink-color.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<button class="test-dialog-open-button" data-test-dialog-id="test-dialog" autofocus>Open Dialog</button>

<div class="mdc-dialog mdc-dialog--open test-dialog test-dialog--title-ink-color"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content"
id="test-dialog">
id="test-dialog">
<div class="mdc-dialog__scrim"></div>
<div class="mdc-dialog__container">
<div class="mdc-dialog__surface">
<div class="mdc-dialog__surface"
role="alertdialog"
aria-modal="true"
aria-labelledby="test-dialog__title"
aria-describedby="test-dialog__content">
<h2 class="mdc-dialog__title test-dialog__title test-dialog__title--3-line" id="test-dialog__title"><!--
-->“The Count of Monte Cristo” by Alexandre <span class="test-font--redact-all">Dumas</span>.<br>
Published in 1844 and translated by Robin Buss.<br>
Expand Down

0 comments on commit c704b71

Please sign in to comment.