Fix OOP <webview> resize and autosize.
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components-chromium / paper-radio-button / paper-radio-button-extracted.js
blobe88bcbbd801d07a4df92bd4948b21e4a7d5a0c20
1 Polymer({
2       is: 'paper-radio-button',
4       behaviors: [
5         Polymer.PaperInkyFocusBehavior,
6         Polymer.IronCheckedElementBehavior
7       ],
9       hostAttributes: {
10         role: 'radio',
11         'aria-checked': false,
12         tabindex: 0
13       },
15       properties: {
16         /**
17          * Fired when the checked state changes due to user interaction.
18          *
19          * @event change
20          */
22         /**
23          * Fired when the checked state changes.
24          *
25          * @event iron-change
26          */
28          ariaActiveAttribute: {
29            value: 'aria-checked'
30          }
31       },
33       attached: function() {
34         this._isReady = true;
36         // Don't stomp over a user-set aria-label.
37         if (!this.getAttribute('aria-label')) {
38           this.updateAriaLabel();
39         }
40       },
42       /**
43        * Update the checkbox aria-label. This is a temporary workaround not
44        * being able to observe changes in <content>
45        * (see: https://github.com/Polymer/polymer/issues/1773)
46        *
47        * Call this if you manually change the contents of the checkbox
48        * and want the aria-label to match the new contents.
49        */
50       updateAriaLabel: function() {
51         this.setAttribute('aria-label', Polymer.dom(this).textContent.trim());
52       },
54       _buttonStateChanged: function() {
55         if (this.disabled) {
56           return;
57         }
58         if (this._isReady) {
59           this.checked = this.active;
60         }
61       }
62     });