Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/url.js

Issue 29333522: Issue 3515 - Adapted polyfill for URL class for consistency (Closed)
Patch Set: Rebased and addressed comments Created Jan. 19, 2016, 2:11 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/polyfills/url.js ('k') | metadata.common » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/url.js
===================================================================
--- a/lib/url.js
+++ b/lib/url.js
@@ -17,37 +17,6 @@
/** @module url */
-window.URL = (function()
-{
- let URL = window.URL || window.webkitURL;
- let URLProperties = ["href", "protocol", "host", "hostname", "pathname", "search"];
-
- if (!URL || !URLProperties.every(prop => prop in new URL("about:blank")))
- {
- let doc = document.implementation.createHTMLDocument();
-
- let base = doc.createElement("base");
- doc.head.appendChild(base);
-
- let anchor = doc.createElement("a");
- doc.body.appendChild(anchor);
-
- URL = function(url, baseUrl)
- {
- if (baseUrl instanceof URL)
- base.href = baseUrl.href;
- else
- base.href = baseUrl || "";
- anchor.href = url;
-
- for (let prop of URLProperties)
- this[prop] = anchor[prop];
- };
- }
-
- return URL;
-})();
-
/**
* Gets the IDN-decoded hostname from a URL object.
*
« no previous file with comments | « lib/polyfills/url.js ('k') | metadata.common » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld