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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js

Issue 1468623004: Update Polymer from 1.2.1 -> 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@travis-yml
Patch Set: local-state.html Created 5 years, 1 month 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-chromium/paper-behaviors/paper-ripple-behavior-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js
index ae3493da4174ed21a139bb15516c51aa1ab9fadb..ca6f6e069eac144c341b58b12bf3ebdf310b2d37 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-behaviors/paper-ripple-behavior-extracted.js
@@ -51,10 +51,10 @@
/**
* Ensures this element contains a ripple effect. For startup efficiency
* the ripple effect is dynamically on demand when needed.
- * @param {!Event=} opt_triggeringEvent (optional) event that triggered the
+ * @param {!Event=} optTriggeringEvent (optional) event that triggered the
* ripple.
*/
- ensureRipple: function(opt_triggeringEvent) {
+ ensureRipple: function(optTriggeringEvent) {
if (!this.hasRipple()) {
this._ripple = this._createRipple();
this._ripple.noink = this.noink;
@@ -62,12 +62,14 @@
if (rippleContainer) {
Polymer.dom(rippleContainer).appendChild(this._ripple);
}
- var domContainer = rippleContainer === this.shadyRoot ? this :
- rippleContainer;
- if (opt_triggeringEvent) {
- var target = opt_triggeringEvent.target;
- if (domContainer.contains(/** @type {Node} */(target))) {
- this._ripple.uiDownAction(opt_triggeringEvent);
+ if (optTriggeringEvent) {
+ // Check if the event happened inside of the ripple container
+ // Fall back to host instead of the root because distributed text
+ // nodes are not valid event targets
+ var domContainer = Polymer.dom(this._rippleContainer || this);
+ var target = Polymer.dom(optTriggeringEvent).rootTarget;
+ if (domContainer.deepContains( /** @type {Node} */(target))) {
+ this._ripple.uiDownAction(optTriggeringEvent);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698