restore ForceLiveStream param

This commit is contained in:
Luke Pulverenti 2016-04-21 00:04:57 -04:00
parent da7c9a4899
commit d0f7abaae8
23 changed files with 149 additions and 94 deletions

View file

@ -1,6 +1,6 @@
{
"name": "iron-dropdown",
"version": "1.3.0",
"version": "1.3.1",
"description": "An unstyled element that works similarly to a native browser select",
"authors": [
"The Polymer Authors"
@ -36,11 +36,11 @@
"iron-image": "polymerelements/iron-image#^1.0.0"
},
"ignore": [],
"_release": "1.3.0",
"_release": "1.3.1",
"_resolution": {
"type": "version",
"tag": "v1.3.0",
"commit": "9d6bb9e7a8150430e61559f5a0827526d2eefaa4"
"tag": "v1.3.1",
"commit": "f7a47d4cd6c6cb87adba08703ec1588c1b649f4d"
},
"_source": "git://github.com/PolymerElements/iron-dropdown.git",
"_target": "^1.0.0",

View file

@ -0,0 +1,33 @@
<!-- Instructions: https://github.com/PolymerElements/iron-dropdown/CONTRIBUTING.md#filing-issues -->
### Description
<!-- Example: The `paper-foo` element causes the page to turn pink when clicked. -->
### Expected outcome
<!-- Example: The page stays the same color. -->
### Actual outcome
<!-- Example: The page turns pink. -->
### Live Demo
<!-- Example: https://jsbin.com/cagaye/edit?html,output -->
### Steps to reproduce
<!-- Example
1. Put a `paper-foo` element in the page.
2. Open the page in a web browser.
3. Click the `paper-foo` element.
-->
### Browsers Affected
<!-- Check all that apply -->
- [ ] Chrome
- [ ] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10

View file

@ -1,5 +1,5 @@
language: node_js
sudo: false
sudo: required
before_script:
- npm install -g bower polylint web-component-tester
- bower install
@ -8,18 +8,16 @@ env:
global:
- secure: Nd7sbgkYVekuQRB4K3svNCL3veA6t6aGopNP2FUxlJvQuzRV1vKV67angPvMUAFelEA7/rTzrFPBMfNbsz9C2wInLLLPux4wEk1MQX+2KYZVeXKMHjgl8iQKMXnodaL7XXwBPg0L7053TWtYkIt8wZ/vN0JGPQFKhlQkSrduzt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n4tve3OVvybSTjQ1yipLxJm/dtjgEXFWtknFZr++tId88wPd3EBtrwEhliD3zD/TyLPO2RPZGuI0i6oD3O89P5d8qp66T/eByDr1IEm0+FIQjgiCEMbhmaIuUKGG2GCfwPglI3uR0kbg0=
- CXX=g++-4.8
node_js: stable
addons:
firefox: latest
apt:
sources:
- google-chrome
- ubuntu-toolchain-r-test
packages:
- google-chrome-stable
- g++-4.8
sauce_connect: true
script:
- xvfb-run wct
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
dist: trusty

View file

@ -1,6 +1,6 @@
{
"name": "iron-dropdown",
"version": "1.3.0",
"version": "1.3.1",
"description": "An unstyled element that works similarly to a native browser select",
"authors": [
"The Polymer Authors"

View file

@ -200,9 +200,9 @@ method is called on the element.
],
attached: function() {
this.positionTarget = this.positionTarget || this._defaultPositionTarget;
// Memoize this to avoid expensive calculations & relayouts.
this._isRTL = window.getComputedStyle(this).direction == 'rtl';
this.positionTarget = this.positionTarget || this._defaultPositionTarget;
},
/**
@ -250,7 +250,7 @@ method is called on the element.
* The horizontal offset value used to position the dropdown.
* @param {ClientRect} dropdownRect
* @param {ClientRect} positionRect
* @param {boolean=false} fromRight
* @param {boolean=} fromRight
* @return {number} pixels
* @private
*/
@ -270,7 +270,7 @@ method is called on the element.
* The vertical offset value used to position the dropdown.
* @param {ClientRect} dropdownRect
* @param {ClientRect} positionRect
* @param {boolean=false} fromBottom
* @param {boolean=} fromBottom
* @return {number} pixels
* @private
*/
@ -288,16 +288,20 @@ method is called on the element.
/**
* Called when the value of `opened` changes.
*
* @param {boolean} opened True if the dropdown is opened.
* Overridden from `IronOverlayBehavior`
*/
_openedChanged: function(opened) {
if (opened && this.disabled) {
_openedChanged: function() {
if (this.opened && this.disabled) {
this.cancel();
} else {
this.cancelAnimation();
this.sizingTarget = this.containedElement || this.sizingTarget;
this._updateAnimationConfig();
if (this.opened && !this.allowOutsideScroll) {
Polymer.IronDropdownScrollManager.pushScrollLock(this);
} else {
Polymer.IronDropdownScrollManager.removeScrollLock(this);
}
Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this, arguments);
}
},
@ -306,10 +310,6 @@ method is called on the element.
* Overridden from `IronOverlayBehavior`.
*/
_renderOpened: function() {
if (!this.allowOutsideScroll) {
Polymer.IronDropdownScrollManager.pushScrollLock(this);
}
if (!this.noAnimations && this.animationConfig && this.animationConfig.open) {
if (this.withBackdrop) {
this.backdropElement.open();
@ -325,7 +325,6 @@ method is called on the element.
* Overridden from `IronOverlayBehavior`.
*/
_renderClosed: function() {
Polymer.IronDropdownScrollManager.removeScrollLock(this);
if (!this.noAnimations && this.animationConfig && this.animationConfig.close) {
if (this.withBackdrop) {
this.backdropElement.close();

View file

@ -48,10 +48,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
height: 50px;
background-color: orange;
}
.full-screen {
width: 100vw;
height: 100vh;
.big {
width: 3000px;
height: 3000px;
}
</style>
<body>
@ -76,7 +76,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<template>
<div class="container">
<iron-dropdown horizontal-align="right" vertical-align="top">
<div class="dropdown-content full-screen"></div>
<div class="dropdown-content big"></div>
</iron-dropdown>
</div>
</template>
@ -143,10 +143,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
contentRect.height > 0;
}
function runAfterOpen(overlay, cb) {
overlay.addEventListener('iron-overlay-opened', function () {
Polymer.Base.async(cb, 1);
});
function runAfterOpen(overlay, callback) {
overlay.addEventListener('iron-overlay-opened', callback);
overlay.open();
}
@ -174,11 +172,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('hides dropdown content when outside is clicked', function(done) {
runAfterOpen(dropdown, function () {
expect(elementIsVisible(content)).to.be.equal(true);
MockInteractions.tap(dropdown.parentNode);
Polymer.Base.async(function() {
dropdown.addEventListener('iron-overlay-closed', function() {
expect(elementIsVisible(content)).to.be.equal(false);
done();
}, 10);
});
MockInteractions.tap(dropdown.parentNode);
});
});
@ -208,7 +206,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('locking scroll', function() {
var dropdown;
setup(function() {
dropdown = fixture('TrivialDropdown');
@ -236,14 +233,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('non locking scroll', function() {
var dropdown;
setup(function() {
dropdown = fixture('NonLockingDropdown');
});
test('can be disabled with `allowOutsideScroll`', function(done) {
runAfterOpen(dropdown, function () {
runAfterOpen(dropdown, function() {
expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(document.body))
.to.be.equal(false);
done();
@ -253,15 +249,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('aligned dropdown', function() {
var parent;
var parentRect;
var dropdownRect;
setup(function() {
parent = fixture('AlignedDropdown');
dropdown = parent.querySelector('iron-dropdown');
});
test('can be re-aligned to the right and the top', function(done) {
var parentRect;
var dropdownRect;
runAfterOpen(dropdown, function () {
dropdownRect = dropdown.getBoundingClientRect();
parentRect = parent.getBoundingClientRect();
@ -274,9 +270,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
test('can be re-aligned to the bottom', function(done) {
var parentRect;
var dropdownRect;
dropdown.verticalAlign = 'bottom';
runAfterOpen(dropdown, function () {
parentRect = parent.getBoundingClientRect();
@ -290,8 +283,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
test('handles parent\'s stacking context', function(done) {
var parentRect;
var dropdownRect;
// This will create a new stacking context.
parent.style.transform = 'translateZ(0)';
runAfterOpen(dropdown, function () {
@ -309,7 +300,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('when align is left/top, with an offset', function() {
var dropdownRect;
var offsetDropdownRect;
var dropdown;
setup(function() {
var parent = fixture('OffsetDropdownTopLeft');
dropdown = parent.querySelector('iron-dropdown');
@ -318,11 +308,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('can be offset towards the bottom right', function(done) {
runAfterOpen(dropdown, function () {
dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = 10;
dropdown.horizontalOffset = 10;
// Force refit instead of waiting for requestAnimationFrame.
dropdown.refit();
offsetDropdownRect = dropdown.getBoundingClientRect();
// verticalAlign is top, so a positive offset moves down.
assert.equal(dropdownRect.top + 10, offsetDropdownRect.top, 'top ok');
// horizontalAlign is left, so a positive offset moves to the right.
@ -334,11 +324,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('can be offset towards the top left', function(done) {
runAfterOpen(dropdown, function () {
dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = -10;
dropdown.horizontalOffset = -10;
// Force refit instead of waiting for requestAnimationFrame.
dropdown.refit();
offsetDropdownRect = dropdown.getBoundingClientRect();
// verticalAlign is top, so a negative offset moves up.
assert.equal(dropdownRect.top - 10, offsetDropdownRect.top, 'top ok');
// horizontalAlign is left, so a negative offset moves to the left.
@ -351,7 +341,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
suite('when align is right/bottom, with an offset', function() {
var dropdownRect;
var offsetDropdownRect;
var dropdown;
setup(function() {
var parent = fixture('OffsetDropdownBottomRight');
dropdown = parent.querySelector('iron-dropdown');
@ -360,11 +349,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('can be offset towards the top left', function(done) {
runAfterOpen(dropdown, function () {
dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = 10;
dropdown.horizontalOffset = 10;
// Force refit instead of waiting for requestAnimationFrame.
dropdown.refit();
offsetDropdownRect = dropdown.getBoundingClientRect();
// verticalAlign is bottom, so a positive offset moves up.
assert.equal(dropdownRect.bottom - 10, offsetDropdownRect.bottom, 'bottom ok');
// horizontalAlign is right, so a positive offset moves to the left.
@ -376,11 +365,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('can be offset towards the bottom right', function(done) {
runAfterOpen(dropdown, function () {
dropdownRect = dropdown.getBoundingClientRect();
dropdown.verticalOffset = -10;
dropdown.horizontalOffset = -10;
// Force refit instead of waiting for requestAnimationFrame.
dropdown.refit();
offsetDropdownRect = dropdown.getBoundingClientRect();
// verticalAlign is bottom, so a negative offset moves down.
assert.equal(dropdownRect.bottom + 10, offsetDropdownRect.bottom, 'bottom ok');
// horizontalAlign is right, so a positive offset moves to the right.
@ -391,7 +380,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('RTL', function() {
var dropdown;
var dropdownRect;
test('with horizontalAlign=left', function(done) {