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

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js

Issue 1401633002: Update Polymer from 1.1.4 -> 1.1.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dzhioev@ review Created 5 years, 2 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-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
index 236096963a97af6e41670fd89a1ad5c08d3a956f..4bca3cc73e1940781c51334e3b21ef05eb7748d9 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
@@ -1,5 +1,4 @@
-
- /**
+/**
* The `iron-iconset-svg` element allows users to define their own icon sets
* that contain svg icons. The svg icon elements should be children of the
* `iron-iconset-svg` element. Multiple icons should be given distinct id's.
@@ -166,16 +165,18 @@
*/
_prepareSvgClone: function(sourceSvg, size) {
if (sourceSvg) {
- var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
- svg.setAttribute('viewBox', ['0', '0', size, size].join(' '));
+ var content = sourceSvg.cloneNode(true),
+ svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'),
+ viewBox = content.getAttribute('viewBox') || '0 0 ' + size + ' ' + size;
+ svg.setAttribute('viewBox', viewBox);
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
// TODO(dfreedm): `pointer-events: none` works around https://crbug.com/370136
// TODO(sjmiles): inline style may not be ideal, but avoids requiring a shadow-root
svg.style.cssText = 'pointer-events: none; display: block; width: 100%; height: 100%;';
- svg.appendChild(sourceSvg.cloneNode(true)).removeAttribute('id');
+ svg.appendChild(content).removeAttribute('id');
return svg;
}
return null;
}
- });
+ });

Powered by Google App Engine
This is Rietveld 408576698