summaryrefslogtreecommitdiffstats
path: root/third_party/polymer/v1_0/components-chromium/iron-selector
diff options
context:
space:
mode:
authortommycli <tommycli@chromium.org>2015-11-05 13:32:19 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-05 21:33:08 +0000
commitb136c252056b6782614356b9666c41db0377df90 (patch)
tree4bce0c36f7587c03ac2d4465a1d10e58c21cb833 /third_party/polymer/v1_0/components-chromium/iron-selector
parent2ae6c8360dfbc0638cff325f4c9f631893c04a32 (diff)
downloadchromium_src-b136c252056b6782614356b9666c41db0377df90.zip
chromium_src-b136c252056b6782614356b9666c41db0377df90.tar.gz
chromium_src-b136c252056b6782614356b9666c41db0377df90.tar.bz2
Settings Rewrite: Roll Polymer version to latest.
Rolls polymer version to latest. Adds some local modifications (reflected in chromium.patch) to get closure compilation to work. BUG=537405 Review URL: https://codereview.chromium.org/1408383009 Cr-Commit-Position: refs/heads/master@{#358132}
Diffstat (limited to 'third_party/polymer/v1_0/components-chromium/iron-selector')
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json14
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-selector/.travis.yml28
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-selector/bower.json8
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js5
-rw-r--r--third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js73
5 files changed, 72 insertions, 56 deletions
diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json b/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json
index 8c65ba5..52d44c1 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-selector/.bower.json
@@ -1,12 +1,10 @@
{
"name": "iron-selector",
- "version": "1.0.7",
+ "version": "1.0.8",
"description": "Manages a set of elements that can be selected",
"private": true,
"license": "http://polymer.github.io/LICENSE.txt",
- "main": [
- "iron-selector.html"
- ],
+ "main": "iron-selector.html",
"authors": [
"The Polymer Authors"
],
@@ -22,7 +20,7 @@
"homepage": "https://github.com/PolymerElements/iron-selector",
"ignore": [],
"dependencies": {
- "polymer": "Polymer/polymer#^1.0.0"
+ "polymer": "Polymer/polymer#^1.2.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
@@ -32,11 +30,11 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "_release": "1.0.7",
+ "_release": "1.0.8",
"_resolution": {
"type": "version",
- "tag": "v1.0.7",
- "commit": "0b2f484ac3b1b03400da2d38b0f543f3688150a4"
+ "tag": "v1.0.8",
+ "commit": "e9a66727f3da0446f04956d4e4f1dcd51cdec2ff"
},
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/.travis.yml b/third_party/polymer/v1_0/components-chromium/iron-selector/.travis.yml
new file mode 100644
index 0000000..eca9321
--- /dev/null
+++ b/third_party/polymer/v1_0/components-chromium/iron-selector/.travis.yml
@@ -0,0 +1,28 @@
+language: node_js
+sudo: false
+matrix:
+ include:
+ - node_js: stable
+ script: xvfb-run wct
+ addons:
+ firefox: latest
+ apt:
+ sources:
+ - google-chrome
+ packages:
+ - google-chrome-stable
+ - node_js: node
+ script:
+ - |
+ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
+ wct -s 'default'
+ fi
+before_script:
+- npm install web-component-tester
+- npm install bower
+- export PATH=$PWD/node_modules/.bin:$PATH
+- bower install
+env:
+ global:
+ - secure: ltCkwJM0nkTS9WjikyjqBsB5J2hQon4UnVVrINk4y+Vq4v9PQJH3+83nya0jnxilKaeAJs4d2/OS02F9GkqYpsSmDz7OgXPfk0hrHA8UksvvpSALfnukleIAN2YTOcxXJKeNHcfpqCKPk1dGeNQOEM61H+QgTBIyFB3sMugygqs=
+ - secure: TJuu1WdpFLTaBN/prBafm8Pld/BQCySNuuG1nATbF3fqiOpgehXu8Z5URAz5syUhqZAyEmuRMxvXpEVD/t1jrtaXVwkdCFkkQ4ckkP4gTIeSGA/Puw8sveB2q7QAqXyTmeFkocNlh8fxV+B07o0SPWdhcvdZnDVU9VrpSqL+92M=
diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json b/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json
index ff00842..a633301 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json
+++ b/third_party/polymer/v1_0/components-chromium/iron-selector/bower.json
@@ -1,12 +1,10 @@
{
"name": "iron-selector",
- "version": "1.0.7",
+ "version": "1.0.8",
"description": "Manages a set of elements that can be selected",
"private": true,
"license": "http://polymer.github.io/LICENSE.txt",
- "main": [
- "iron-selector.html"
- ],
+ "main": "iron-selector.html",
"authors": [
"The Polymer Authors"
],
@@ -22,7 +20,7 @@
"homepage": "https://github.com/PolymerElements/iron-selector",
"ignore": [],
"dependencies": {
- "polymer": "Polymer/polymer#^1.0.0"
+ "polymer": "Polymer/polymer#^1.2.0"
},
"devDependencies": {
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js
index c1cc623..de4827b 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-multi-selectable-extracted.js
@@ -58,6 +58,11 @@
this._selection.multi = multi;
},
+ get _shouldUpdateSelection() {
+ return this.selected != null ||
+ (this.selectedValues != null && this.selectedValues.length);
+ },
+
_updateSelected: function() {
if (this.multi) {
this._selectMulti(this.selectedValues);
diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js
index 4afe648..f52a512 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selectable-extracted.js
@@ -50,6 +50,8 @@
/**
* Returns the currently selected item.
+ *
+ * @type {?Object}
*/
selectedItem: {
type: Object,
@@ -91,10 +93,20 @@
},
/**
+ * The list of items from which a selection can be made.
+ */
+ items: {
+ type: Array,
+ readOnly: true,
+ value: function() {
+ return [];
+ }
+ },
+
+ /**
* The set of excluded elements where the key is the `localName`
* of the element that will be ignored from the item list.
*
- * @type {object}
* @default {template: 1}
*/
_excludedLocalNames: {
@@ -114,15 +126,12 @@
created: function() {
this._bindFilterItem = this._filterItem.bind(this);
this._selection = new Polymer.IronSelection(this._applySelection.bind(this));
- // TODO(cdata): When polymer/polymer#2535 lands, we do not need to do this
- // book keeping anymore:
- this.__listeningForActivate = false;
},
attached: function() {
this._observer = this._observeItems(this);
- this._contentObserver = this._observeContent(this);
- if (!this.selectedItem && this.selected) {
+ this._updateItems();
+ if (!this._shouldUpdateSelection) {
this._updateSelected(this.attrForSelected,this.selected)
}
this._addListener(this.activateEvent);
@@ -130,26 +139,12 @@
detached: function() {
if (this._observer) {
- this._observer.disconnect();
- }
- if (this._contentObserver) {
- this._contentObserver.disconnect();
+ Polymer.dom(this).unobserveNodes(this._observer);
}
this._removeListener(this.activateEvent);
},
/**
- * Returns an array of selectable items.
- *
- * @property items
- * @type Array
- */
- get items() {
- var nodes = Polymer.dom(this).queryDistributedElements(this.selectable || '*');
- return Array.prototype.filter.call(nodes, this._bindFilterItem);
- },
-
- /**
* Returns the index of the given item.
*
* @method indexOf
@@ -191,18 +186,16 @@
this.selected = this._indexToValue(index);
},
- _addListener: function(eventName) {
- if (!this.isAttached || this.__listeningForActivate) {
- return;
- }
+ get _shouldUpdateSelection() {
+ return this.selected != null;
+ },
- this.__listeningForActivate = true;
+ _addListener: function(eventName) {
this.listen(this, eventName, '_activateHandler');
},
_removeListener: function(eventName) {
this.unlisten(this, eventName, '_activateHandler');
- this.__listeningForActivate = false;
},
_activateEventChanged: function(eventName, old) {
@@ -210,6 +203,12 @@
this._addListener(eventName);
},
+ _updateItems: function() {
+ var nodes = Polymer.dom(this).queryDistributedElements(this.selectable || '*');
+ nodes = Array.prototype.filter.call(nodes, this._bindFilterItem);
+ this._setItems(nodes);
+ },
+
_updateSelected: function() {
this._selectSelected(this.selected);
},
@@ -268,18 +267,9 @@
this._setSelectedItem(this._selection.get());
},
- // observe content changes under the given node.
- _observeContent: function(node) {
- var content = node.querySelector('content');
- if (content && content.parentElement === node) {
- return this._observeItems(node.domHost);
- }
- },
-
// observe items change under the given node.
_observeItems: function(node) {
- // TODO(cdata): Update this when we get distributed children changed.
- var observer = new MutationObserver(function(mutations) {
+ return Polymer.dom(node).observeNodes(function(mutations) {
// Let other interested parties know about the change so that
// we don't have to recreate mutation observers everywher.
this.fire('iron-items-changed', mutations, {
@@ -287,15 +277,12 @@
cancelable: false
});
- if (this.selected != null) {
+ this._updateItems();
+
+ if (this._shouldUpdateSelection) {
this._updateSelected();
}
- }.bind(this));
- observer.observe(node, {
- childList: true,
- subtree: true
});
- return observer;
},
_activateHandler: function(e) {