Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-location/iron-location-extracted.js

Issue 1901343004: [Polymer] update third_party polymer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new pull Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/iron-location/iron-location-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-location/iron-location-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-location/iron-location-extracted.js
index 37b576cc38145e0a6c3eb6dd6d896c1070d08e2b..85ea5f375015c960490df908cbf01066b3e73bfa 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-location/iron-location-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-location/iron-location-extracted.js
@@ -95,8 +95,8 @@
this.listen(window, 'popstate', '_urlChanged');
this.listen(/** @type {!HTMLBodyElement} */(document.body), 'click', '_globalOnClick');
- this._urlChanged();
this._initialized = true;
+ this._urlChanged();
},
detached: function() {
this.unlisten(window, 'hashchange', '_hashChanged');
@@ -157,14 +157,17 @@
// nothing to do, the URL didn't change
return;
}
+ // Need to use a full URL in case the containing page has a base URI.
+ var fullNewUrl = new URL(
+ newUrl, window.location.protocol + '//' + window.location.host).href;
var now = this._now();
var shouldReplace =
this._lastChangedAt + this.dwellTime > now;
this._lastChangedAt = now;
if (shouldReplace) {
- window.history.replaceState({}, '', newUrl);
+ window.history.replaceState({}, '', fullNewUrl);
} else {
- window.history.pushState({}, '', newUrl);
+ window.history.pushState({}, '', fullNewUrl);
}
this.fire('location-changed', {}, {node: window});
},
@@ -179,7 +182,6 @@
if (!href) {
return;
}
-
window.history.pushState({}, '', href);
this.fire('location-changed', {}, {node: window});
event.preventDefault();
@@ -252,8 +254,10 @@
!this._urlSpaceRegExp.test(normalizedHref)) {
return null;
}
-
- return normalizedHref;
+ // Need to use a full URL in case the containing page has a base URI.
+ var fullNormalizedHref = new URL(
+ normalizedHref, window.location.href).href;
+ return fullNormalizedHref;
},
_makeRegExp: function(urlSpaceRegex) {
return RegExp(urlSpaceRegex);

Powered by Google App Engine
This is Rietveld 408576698