update polymer
This commit is contained in:
parent
64e22073e0
commit
3223d4672a
55 changed files with 359 additions and 253 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.11",
|
||||
"description": "Provides a set of behaviors for the iron elements",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
@ -16,25 +16,27 @@
|
|||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.2.0",
|
||||
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"paper-input": "polymerelements/paper-input#^1.0.0",
|
||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"web-component-tester": "polymer/web-component-tester#^3.4.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-behaviors",
|
||||
"_release": "1.0.10",
|
||||
"ignore": [],
|
||||
"homepage": "https://github.com/PolymerElements/iron-behaviors",
|
||||
"_release": "1.0.11",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.10",
|
||||
"commit": "da937a6c5841fc9dba57f3087083445c9ad709a8"
|
||||
"tag": "v1.0.11",
|
||||
"commit": "084fbc7f60343d717bb2208f350774f4c9899777"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-behaviors.git",
|
||||
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-behaviors"
|
||||
"_originalSource": "PolymerElements/iron-behaviors"
|
||||
}
|
|
@ -1,12 +1,9 @@
|
|||
language: node_js
|
||||
sudo: false
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
matrix:
|
||||
include:
|
||||
- node_js: stable
|
||||
script: xvfb-run -a wct --simpleOutput -l firefox -l chrome
|
||||
script: xvfb-run wct
|
||||
addons:
|
||||
firefox: latest
|
||||
apt:
|
||||
|
@ -18,10 +15,11 @@ matrix:
|
|||
script:
|
||||
- |
|
||||
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
||||
wct --simpleOutput -s 'Windows 10/microsoftedge' -s 'Windows 8.1/internet explorer@11' -s 'Windows 7/internet explorer@10' -s 'OS X 10.10/safari@8' -s 'OS X 10.9/safari@7'
|
||||
wct -s 'default'
|
||||
fi
|
||||
before_script:
|
||||
- npm install bower web-component-tester
|
||||
- npm install bower
|
||||
- npm install web-component-tester
|
||||
- export PATH=$PWD/node_modules/.bin:$PATH
|
||||
- bower install
|
||||
env:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "iron-behaviors",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.11",
|
||||
"description": "Provides a set of behaviors for the iron elements",
|
||||
"private": true,
|
||||
"authors": [
|
||||
|
@ -16,15 +16,17 @@
|
|||
],
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"dependencies": {
|
||||
"polymer": "Polymer/polymer#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.2.0",
|
||||
"iron-a11y-keys-behavior": "PolymerElements/iron-a11y-keys-behavior#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"paper-styles": "polymerelements/paper-styles#^1.0.2",
|
||||
"paper-input": "polymerelements/paper-input#^1.0.0",
|
||||
"iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"web-component-tester": "polymer/web-component-tester#^3.4.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
}
|
||||
},
|
||||
"ignore": []
|
||||
}
|
||||
|
|
|
@ -136,14 +136,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
this._setPressed(false);
|
||||
},
|
||||
|
||||
__isFocusedLightDescendant: function(target) {
|
||||
var root = Polymer.dom(this).getOwnerRoot() || document;
|
||||
var focusedElement = root.activeElement;
|
||||
|
||||
// TODO(noms): remove the `this !== target` check once polymer#2610 is fixed.
|
||||
return this !== target && this.isLightDescendant(target) && target == focusedElement;
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {!KeyboardEvent} event .
|
||||
*/
|
||||
|
@ -153,7 +145,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
// Ignore the event if this is coming from a focused light child, since that
|
||||
// element will deal with it.
|
||||
if (this.__isFocusedLightDescendant(target))
|
||||
if (this.isLightDescendant(target))
|
||||
return;
|
||||
|
||||
keyboardEvent.preventDefault();
|
||||
|
@ -170,7 +162,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
// Ignore the event if this is coming from a focused light child, since that
|
||||
// element will deal with it.
|
||||
if (this.__isFocusedLightDescendant(target))
|
||||
if (this.isLightDescendant(target))
|
||||
return;
|
||||
|
||||
if (this.pressed) {
|
||||
|
|
|
@ -13,12 +13,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="test-elements.html">
|
||||
<link rel="import" href="../../paper-input/paper-input.html">
|
||||
</head>
|
||||
<body>
|
||||
<test-fixture id="TrivialActiveState">
|
||||
|
@ -33,12 +30,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="ButtonWithInput">
|
||||
<test-fixture id="ButtonWithNativeInput">
|
||||
<template>
|
||||
<test-light-dom><input id="input"></test-light-dom>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="ButtonWithPaperInput">
|
||||
<template>
|
||||
<test-light-dom><paper-input id="input"></paper-input></test-light-dom>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('active-state', function() {
|
||||
var activeTarget;
|
||||
|
@ -199,9 +202,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
});
|
||||
});
|
||||
|
||||
suite('nested input inside button', function() {
|
||||
suite('nested native input inside button', function() {
|
||||
test('space in light child input does not trigger a button click event', function(done) {
|
||||
var item = fixture('ButtonWithInput');
|
||||
var item = fixture('ButtonWithNativeInput');
|
||||
var input = item.querySelector('#input');
|
||||
|
||||
var itemClickHandler = sinon.spy();
|
||||
|
@ -209,14 +212,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
input.focus();
|
||||
MockInteractions.pressSpace(input);
|
||||
setTimeout(function(){
|
||||
Polymer.Base.async(function(){
|
||||
expect(itemClickHandler.callCount).to.be.equal(0);
|
||||
done();
|
||||
}, 100);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
test('space in button triggers a button click event', function(done) {
|
||||
var item = fixture('ButtonWithInput');
|
||||
var item = fixture('ButtonWithNativeInput');
|
||||
var input = item.querySelector('#input');
|
||||
|
||||
var itemClickHandler = sinon.spy();
|
||||
|
@ -224,10 +227,49 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
MockInteractions.pressSpace(item);
|
||||
|
||||
setTimeout(function(){
|
||||
expect(itemClickHandler.callCount).to.be.equal(1);
|
||||
Polymer.Base.async(function(){
|
||||
// You need two ticks, one for the MockInteractions event, and one
|
||||
// for the button event.
|
||||
Polymer.Base.async(function(){
|
||||
expect(itemClickHandler.callCount).to.be.equal(1);
|
||||
done();
|
||||
}, 1);
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
suite('nested paper-input inside button', function() {
|
||||
test('space in light child input does not trigger a button click event', function(done) {
|
||||
var item = fixture('ButtonWithPaperInput');
|
||||
var input = item.querySelector('#input');
|
||||
|
||||
var itemClickHandler = sinon.spy();
|
||||
item.addEventListener('click', itemClickHandler);
|
||||
|
||||
input.focus();
|
||||
MockInteractions.pressSpace(input);
|
||||
Polymer.Base.async(function(){
|
||||
expect(itemClickHandler.callCount).to.be.equal(0);
|
||||
done();
|
||||
}, 100);
|
||||
}, 1);
|
||||
});
|
||||
|
||||
test('space in button triggers a button click event', function(done) {
|
||||
var item = fixture('ButtonWithPaperInput');
|
||||
var input = item.querySelector('#input');
|
||||
|
||||
var itemClickHandler = sinon.spy();
|
||||
item.addEventListener('click', itemClickHandler);
|
||||
|
||||
MockInteractions.pressSpace(item);
|
||||
Polymer.Base.async(function(){
|
||||
// You need two ticks, one for the MockInteractions event, and one
|
||||
// for the button event.
|
||||
Polymer.Base.async(function(){
|
||||
expect(itemClickHandler.callCount).to.be.equal(1);
|
||||
done();
|
||||
}, 1);
|
||||
}, 1);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -13,10 +13,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="test-elements.html">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -13,11 +13,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
<script src="../../iron-test-helpers/mock-interactions.js"></script>
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
<link rel="import" href="test-elements.html">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -135,12 +131,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
lightDOM.addEventListener('focus', function() {
|
||||
nFocusEvents += 1;
|
||||
});
|
||||
|
||||
|
||||
MockInteractions.focus(input);
|
||||
|
||||
expect(nFocusEvents).to.be.equal(0);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -7,6 +7,7 @@ Code distributed by Google as part of the polymer project is also
|
|||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<link rel="import" href="../../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-control-state.html">
|
||||
<link rel="import" href="../iron-button-state.html">
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue