Chromium Code Reviews| Index: third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js |
| diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js |
| index 7e5559f2caa4418fb126151de0d0b166f6054a81..c3a671afbc694296427fb1dc330c2e776c8ad88d 100644 |
| --- a/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js |
| +++ b/third_party/polymer/v1_0/components-chromium/paper-radio-button/paper-radio-button-extracted.js |
| @@ -32,5 +32,23 @@ Polymer({ |
| ready: function() { |
| this._rippleContainer = this.$.radioContainer; |
| - } |
| + }, |
| + |
| + attached: function() { |
| + var inkSize = this.getComputedStyleValue('--calculated-paper-radio-button-ink-size'); |
| + // If unset, compute and set the default `--paper-radio-button-ink-size`. |
| + if (inkSize === '-1px') { |
|
dpapad
2016/11/24 00:02:45
I did a sanity check, and there is a problem in th
|
| + var size = parseFloat(this.getComputedStyleValue('--calculated-paper-radio-button-size')); |
| + var defaultInkSize = Math.floor(3 * size); |
| + |
| + // The button and ripple need to have the same parity so that their |
| + // centers align. |
| + if (defaultInkSize % 2 !== size % 2) { |
| + defaultInkSize++; |
| + } |
| + |
| + this.customStyle['--paper-radio-button-ink-size'] = defaultInkSize + 'px'; |
| + this.updateStyles(); |
| + } |
| + }, |
| }); |