* * 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 will be resolved
(url)
| 17814 | * |
| 17815 | */ |
| 17816 | function urlResolve(url) { |
| 17817 | var href = url; |
| 17818 | |
| 17819 | if (msie) { |
| 17820 | // Normalize before parse. Refer Implementation Notes on why this is |
| 17821 | // done in two steps on IE. |
| 17822 | urlParsingNode.setAttribute("href", href); |
| 17823 | href = urlParsingNode.href; |
| 17824 | } |
| 17825 | |
| 17826 | urlParsingNode.setAttribute('href', href); |
| 17827 | |
| 17828 | // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 17829 | return { |
| 17830 | href: urlParsingNode.href, |
| 17831 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 17832 | host: urlParsingNode.host, |
| 17833 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 17834 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 17835 | hostname: urlParsingNode.hostname, |
| 17836 | port: urlParsingNode.port, |
| 17837 | pathname: (urlParsingNode.pathname.charAt(0) === '/') |
| 17838 | ? urlParsingNode.pathname |
| 17839 | : '/' + urlParsingNode.pathname |
| 17840 | }; |
| 17841 | } |
| 17842 | |
| 17843 | /** |
| 17844 | * Parse a request URL and determine whether this is a same-origin request as the application document. |
no outgoing calls
no test coverage detected