Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-a11y-announcer/iron-a11y-announcer-extracted.js

Issue 1862213002: Roll third_party/polymer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 (function() {
2 'use strict';
3
4 Polymer.IronA11yAnnouncer = Polymer({
5 is: 'iron-a11y-announcer',
6
7 properties: {
8
9 /**
10 * The value of mode is used to set the `aria-live` attribute
11 * for the element that will be announced. Valid values are: `off`,
12 * `polite` and `assertive`.
13 */
14 mode: {
15 type: String,
16 value: 'polite'
17 },
18
19 _text: {
20 type: String,
21 value: ''
22 }
23 },
24
25 created: function() {
26 if (!Polymer.IronA11yAnnouncer.instance) {
27 Polymer.IronA11yAnnouncer.instance = this;
28 }
29
30 document.body.addEventListener('iron-announce', this._onIronAnnounce.b ind(this));
31 },
32
33 /**
34 * Cause a text string to be announced by screen readers.
35 *
36 * @param {string} text The text that should be announced.
37 */
38 announce: function(text) {
39 this._text = '';
40 this.async(function() {
41 this._text = text;
42 }, 100);
43 },
44
45 _onIronAnnounce: function(event) {
46 if (event.detail && event.detail.text) {
47 this.announce(event.detail.text);
48 }
49 }
50 });
51
52 Polymer.IronA11yAnnouncer.instance = null;
53
54 Polymer.IronA11yAnnouncer.requestAvailability = function() {
55 if (!Polymer.IronA11yAnnouncer.instance) {
56 Polymer.IronA11yAnnouncer.instance = document.createElement('iron-a11y -announcer');
57 }
58
59 document.body.appendChild(Polymer.IronA11yAnnouncer.instance);
60 };
61 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698