Commit a3fea651 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Print Preview Destinations Dropdown: Polymer changes

Adding a createIcon() method to IronIconsetSvg, to allow icons in
the iconset to be retrieved and added inline outside of iron-icons. This
is required for Print Preview to use the destination icons in the
background of a dropdown menu while keeping the icons in its iconset.

Bug: 920056
Change-Id: I8f8b68c190cec8b31d9dc5d91adf182adca796f8
Reviewed-on: https://chromium-review.googlesource.com/c/1405457Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622175}
parent 9beb97e8
......@@ -83,6 +83,26 @@ class ResizeObserver {
*/
Polymer.RenderStatus.beforeNextRender = function(element, fn, args) {};
/**
* @see
* https://www.webcomponents.org/element/@polymer/iron-iconset-svg
* Polymer iconset of SVGs.
* @implements {Polymer.Iconset}
* @constructor
* TODO(rbpotter): Remove this once it is added to Closure Compiler itself.
*/
Polymer.IronIconsetSvg = function() {};
/**
* Added to IronIconsetSvg in chromium.patch.
* @param {string} iconName Name of the icon to apply.
* @param {boolean} targetIsRTL Whether the target element is RTL.
* @return {Element} Returns an installable clone of the SVG element
* matching `id`.
* TODO(rbpotter): Remove this once it is added to Closure Compiler itself.
*/
Polymer.IronIconsetSvg.prototype.createIcon = function(iconName, targetIsRTL) {};
/**
* @see
* https://github.com/tc39/proposal-bigint
......
......@@ -9,6 +9,29 @@ index 7a24999..4eefcba 100644
-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic">
-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,700">
+<link rel="stylesheet" href="chrome://resources/css/roboto.css">
diff --git a/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js b/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
index 2edddb115d46..d3c7fbe36d63 100644
--- a/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
+++ b/components-chromium/iron-iconset-svg/iron-iconset-svg-extracted.js
@@ -131,6 +131,18 @@
return null;
},
+ /**
+ * Produce installable clone of the SVG element matching `id` in this
+ * iconset, or `undefined` if there is no matching element.
+ * @param {string} iconName Name of the icon to apply.
+ * @param {boolean} targetIsRTL Whether the target element is RTL.
+ * @return {Element} Returns an installable clone of the SVG element
+ * matching `id`.
+ */
+ createIcon: function(iconName, targetIsRTL) {
+ return this._cloneIcon(iconName, this.rtlMirroring && targetIsRTL);
+ },
+
/**
* Remove an icon from the given element by undoing the changes effected
* by `applyIcon`.
diff --git a/components-chromium/iron-list/iron-list-extracted.js b/components-chromium/iron-list/iron-list-extracted.js
index 43c59653a39b..26652936735c 100644
--- a/components-chromium/iron-list/iron-list-extracted.js
......
......@@ -131,6 +131,18 @@
return null;
},
/**
* Produce installable clone of the SVG element matching `id` in this
* iconset, or `undefined` if there is no matching element.
* @param {string} iconName Name of the icon to apply.
* @param {boolean} targetIsRTL Whether the target element is RTL.
* @return {Element} Returns an installable clone of the SVG element
* matching `id`.
*/
createIcon: function(iconName, targetIsRTL) {
return this._cloneIcon(iconName, this.rtlMirroring && targetIsRTL);
},
/**
* Remove an icon from the given element by undoing the changes effected
* by `applyIcon`.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment