* * Implementation Notes for non-IE browsers * ---------------------------------------- * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, * results both in the normalizing and parsing of the URL. Normalizing means that a relative *
(url)
| 19330 | * |
| 19331 | */ |
| 19332 | function urlResolve(url) { |
| 19333 | var href = url; |
| 19334 | |
| 19335 | if (msie) { |
| 19336 | // Normalize before parse. Refer Implementation Notes on why this is |
| 19337 | // done in two steps on IE. |
| 19338 | urlParsingNode.setAttribute("href", href); |
| 19339 | href = urlParsingNode.href; |
| 19340 | } |
| 19341 | |
| 19342 | urlParsingNode.setAttribute('href', href); |
| 19343 | |
| 19344 | // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 19345 | return { |
| 19346 | href: urlParsingNode.href, |
| 19347 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 19348 | host: urlParsingNode.host, |
| 19349 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 19350 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 19351 | hostname: urlParsingNode.hostname, |
| 19352 | port: urlParsingNode.port, |
| 19353 | pathname: (urlParsingNode.pathname.charAt(0) === '/') |
| 19354 | ? urlParsingNode.pathname |
| 19355 | : '/' + urlParsingNode.pathname |
| 19356 | }; |
| 19357 | } |
| 19358 | |
| 19359 | /** |
| 19360 | * Parse a request URL and determine whether this is a same-origin request as the application document. |
no outgoing calls
no test coverage detected