Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.

Commit c2c861d

Browse files
committed
[DEV] Prevent pointer move behaviour from selection and pointer leave
1 parent f51fe7f commit c2c861d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1783
-6704
lines changed

docs/components/app-layout/.bower.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "app-layout",
3-
"version": "2.0.2",
3+
"version": "2.0.4",
44
"description": "A set of layout elements for your app",
55
"authors": [
66
"The Polymer Authors"
@@ -65,11 +65,11 @@
6565
"resolutions": {
6666
"webcomponentsjs": "^1.0.0"
6767
},
68-
"_release": "2.0.2",
68+
"_release": "2.0.4",
6969
"_resolution": {
7070
"type": "version",
71-
"tag": "v2.0.2",
72-
"commit": "502cbfe604a3017ac22ad924a11668143354e828"
71+
"tag": "v2.0.4",
72+
"commit": "623997a76bea695a51de0d4e96e11a8198e367da"
7373
},
7474
"_source": "https://github.com/PolymerElements/app-layout.git",
7575
"_target": "1 - 2",

docs/components/app-layout/app-header/app-header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ <h1 main-title>App name</h1>
452452
}
453453
var nodes = Polymer.dom(this.$.slot).getDistributedNodes();
454454
// Get the element with the sticky attribute on it or the first element in the light DOM.
455-
for (var i = 0, node; node = nodes[i]; i++) {
455+
for (var i = 0, node; node = /** @type {!HTMLElement} */ (nodes[i]); i++) {
456456
if (node.nodeType === Node.ELEMENT_NODE) {
457457
if (node.hasAttribute('sticky')) {
458458
this._stickyElRef = node;

docs/components/app-layout/app-scroll-effects/effects/parallax-background.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
if (isNaN(scalar)) {
3131
scalar = 0.8;
3232
}
33-
fx.deltaBg = this._dHeight * scalar;
33+
fx.deltaBg = (this._dHeight || 0) * scalar;
3434
} else {
3535
if (isNaN(scalar)) {
3636
scalar = 1;

docs/components/app-layout/bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "app-layout",
3-
"version": "2.0.2",
3+
"version": "2.0.4",
44
"description": "A set of layout elements for your app",
55
"authors": [
66
"The Polymer Authors"

docs/components/app-layout/helpers/helpers.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@
133133
// This seems to only apply when using document scrolling.
134134
// Therefore, when should we remove the class from the document element?
135135

136-
window.cancelAnimationFrame(Polymer.AppLayout._scrollTimer);
136+
if (Polymer.AppLayout._scrollTimer) {
137+
window.cancelAnimationFrame(Polymer.AppLayout._scrollTimer);
138+
}
137139

138140
Polymer.AppLayout._scrollTimer = window.requestAnimationFrame(function() {
139141
headers.forEach(function(header) {

docs/components/iron-location/.bower.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iron-location",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Bidirectional data binding into the page's URL.",
55
"private": true,
66
"authors": [
@@ -59,11 +59,11 @@
5959
"resolutions": {
6060
"webcomponentsjs": "^1.0.0"
6161
},
62-
"_release": "2.0.1",
62+
"_release": "2.0.2",
6363
"_resolution": {
6464
"type": "version",
65-
"tag": "v2.0.1",
66-
"commit": "faaa959813d1dfa5defc5db30e55e799c89ec903"
65+
"tag": "v2.0.2",
66+
"commit": "10493907e6ba30b2bd9d21c0f91209d08416b4e8"
6767
},
6868
"_source": "https://github.com/PolymerElements/iron-location.git",
6969
"_target": "1 - 2",

docs/components/iron-location/bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "iron-location",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Bidirectional data binding into the page's URL.",
55
"private": true,
66
"authors": [

docs/components/iron-location/iron-location.html

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@
181181
'_updateUrl(path, query, hash)'
182182
],
183183

184+
created: function() {
185+
this.__location = window.location;
186+
},
187+
184188
attached: function() {
185189
this.listen(window, 'hashchange', '_hashChanged');
186190
this.listen(window, 'location-changed', '_urlChanged');
@@ -203,7 +207,7 @@
203207
},
204208

205209
_hashChanged: function() {
206-
this.hash = window.decodeURIComponent(window.location.hash.substring(1));
210+
this.hash = window.decodeURIComponent(this.__location.hash.substring(1));
207211
},
208212

209213
_urlChanged: function() {
@@ -214,8 +218,8 @@
214218
// one when we set this.hash. Likewise for query.
215219
this._dontUpdateUrl = true;
216220
this._hashChanged();
217-
this.path = window.decodeURIComponent(window.location.pathname);
218-
this.query = window.location.search.substring(1);
221+
this.path = window.decodeURIComponent(this.__location.pathname);
222+
this.query = this.__location.search.substring(1);
219223
this._dontUpdateUrl = false;
220224
this._updateUrl();
221225
},
@@ -240,17 +244,17 @@
240244
return;
241245
}
242246

243-
if (this.path === window.decodeURIComponent(window.location.pathname) &&
244-
this.query === window.location.search.substring(1) &&
247+
if (this.path === window.decodeURIComponent(this.__location.pathname) &&
248+
this.query === this.__location.search.substring(1) &&
245249
this.hash === window.decodeURIComponent(
246-
window.location.hash.substring(1))) {
250+
this.__location.hash.substring(1))) {
247251
// Nothing to do, the current URL is a representation of our properties.
248252
return;
249253
}
250254

251255
var newUrl = this._getUrl();
252256
// Need to use a full URL in case the containing page has a base URI.
253-
var fullNewUrl = resolveURL(newUrl, window.location.protocol + '//' + window.location.host).href;
257+
var fullNewUrl = resolveURL(newUrl, this.__location.protocol + '//' + this.__location.host).href;
254258
var now = window.performance.now();
255259
var shouldReplace = this._lastChangedAt + this.dwellTime > now;
256260
this._lastChangedAt = now;
@@ -288,7 +292,7 @@
288292

289293
// If the navigation is to the current page we shouldn't add a history
290294
// entry or fire a change event.
291-
if (href === window.location.href) {
295+
if (href === this.__location.href) {
292296
return;
293297
}
294298

@@ -360,18 +364,29 @@
360364
var origin;
361365

362366
// IE Polyfill
363-
if (window.location.origin) {
364-
origin = window.location.origin;
367+
if (this.__location.origin) {
368+
origin = this.__location.origin;
365369
} else {
366-
origin = window.location.protocol + '//' + window.location.host;
370+
origin = this.__location.protocol + '//' + this.__location.host;
367371
}
368372

369373
var urlOrigin;
370374

371375
if (url.origin) {
372376
urlOrigin = url.origin;
373377
} else {
374-
urlOrigin = url.protocol + '//' + url.host;
378+
// IE always adds port number on HTTP and HTTPS on <a>.host but not on
379+
// window.location.host
380+
var urlHost = url.host;
381+
var urlPort = url.port;
382+
var urlProtocol = url.protocol;
383+
var isExtraneousHTTPS = urlProtocol === 'https:' && urlPort === '443';
384+
var isExtraneousHTTP = urlProtocol === 'http:' && urlPort === '80';
385+
386+
if (isExtraneousHTTPS || isExtraneousHTTP) {
387+
urlHost = url.hostname;
388+
}
389+
urlOrigin = urlProtocol + '//' + urlHost;
375390
}
376391

377392
if (urlOrigin !== origin) {
@@ -393,7 +408,7 @@
393408

394409
// Need to use a full URL in case the containing page has a base URI.
395410
var fullNormalizedHref = resolveURL(
396-
normalizedHref, window.location.href).href;
411+
normalizedHref, this.__location.href).href;
397412
return fullNormalizedHref;
398413
},
399414

docs/components/iron-location/test/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
<script>
1919
WCT.loadSuites([
2020
'iron-location.html?dom=shadow',
21+
'iron-location-base-uri.html?dom=shadow',
2122
'iron-query-params.html?dom=shadow',
2223
'initialization-tests.html?dom=shadow',
2324
'integration.html?dom=shadow',
2425
'iron-location.html?wc-shadydom=true&wc-ce=true',
26+
'iron-location-base-uri.html?wc-shadydom=true&wc-ce=true',
2527
'iron-query-params.html?wc-shadydom=true&wc-ce=true',
2628
'initialization-tests.html?wc-shadydom=true&wc-ce=true',
2729
'integration.html?wc-shadydom=true&wc-ce=true'

docs/components/iron-location/test/initialization-tests.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@
113113
});
114114
var cases = [
115115
'default-before', 'attached-before', 'ready-before',
116-
'default-after', 'attached-after', 'ready-after',
117-
'default-below', 'attached-below', 'ready-below',
116+
// TODO: These tests are failing with Polymer 2 (#95).
117+
// 'default-after', 'attached-after', 'ready-after',
118+
// 'default-below', 'attached-below', 'ready-below',
118119
'default-above', 'attached-above', 'ready-above',
119120
'default-container', 'attached-container', 'ready-container'
120121
];

0 commit comments

Comments
 (0)