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

Unified Diff: third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html

Issue 1187823002: Update Polymer components and re-run reproduce.sh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html
diff --git a/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html b/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html
index 99d8d8886e4b0b85d76c95542332f98fbe7a4e27..f4164ce06db098eb3233125d415bd6fd40e0e387 100644
--- a/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html
+++ b/third_party/polymer/v1_0/components/paper-icon-button/paper-icon-button.html
@@ -13,15 +13,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../paper-styles/default-theme.html">
<link rel="import" href="../paper-behaviors/paper-button-behavior.html">
-<link rel="import" href="../paper-behaviors/paper-radio-button-behavior.html">
+<link rel="import" href="../paper-behaviors/paper-inky-focus-behavior.html">
<link rel="import" href="../paper-ripple/paper-ripple.html">
-<style is="custom-style">
- :root {
- --paper-icon-button-disabled-text: var(--disabled-text-color);
- }
-</style>
-
<!--
Material Design: <a href="http://www.google.com/design/spec/components/buttons.html">Buttons</a>
@@ -99,7 +93,7 @@ Custom property | Description | Default
}
:host([disabled]) {
- color: var(--paper-icon-button-disabled-text, #fff);
+ color: var(--paper-icon-button-disabled-text, --disabled-text-color);
pointer-events: none;
cursor: auto;
@apply(--paper-icon-button-disabled);
@@ -107,16 +101,20 @@ Custom property | Description | Default
</style>
<template>
<paper-ripple id="ink" class="circle" center></paper-ripple>
- <iron-icon id="icon" src="[[src]]" icon="[[icon]]"></iron-icon>
+ <iron-icon id="icon" src="[[src]]" icon="[[icon]]" alt$="[[alt]]"></iron-icon>
</template>
</dom-module>
<script>
Polymer({
is: 'paper-icon-button',
+ hostAttributes: {
+ role: 'button',
+ tabindex: '0'
+ },
+
behaviors: [
- Polymer.PaperButtonBehavior,
- Polymer.PaperRadioButtonBehavior
+ Polymer.PaperInkyFocusBehavior
],
properties: {
@@ -135,6 +133,23 @@ Custom property | Description | Default
*/
icon: {
type: String
+ },
+
+ /**
+ * Specifies the alternate text for the button, for accessibility.
+ */
+ alt: {
+ type: String,
+ observer: "_altChanged"
+ }
+ },
+
+ _altChanged: function(newValue, oldValue) {
+ var label = this.getAttribute('aria-label');
+
+ // Don't stomp over a user-set aria-label.
+ if (!label || oldValue == label) {
+ this.setAttribute('aria-label', newValue);
}
}
});

Powered by Google App Engine
This is Rietveld 408576698