* * 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)
| 16512 | * |
| 16513 | */ |
| 16514 | function urlResolve(url) { |
| 16515 | var href = url; |
| 16516 | |
| 16517 | if (msie) { |
| 16518 | // Normalize before parse. Refer Implementation Notes on why this is |
| 16519 | // done in two steps on IE. |
| 16520 | urlParsingNode.setAttribute("href", href); |
| 16521 | href = urlParsingNode.href; |
| 16522 | } |
| 16523 | |
| 16524 | urlParsingNode.setAttribute('href', href); |
| 16525 | |
| 16526 | // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils |
| 16527 | return { |
| 16528 | href: urlParsingNode.href, |
| 16529 | protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', |
| 16530 | host: urlParsingNode.host, |
| 16531 | search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', |
| 16532 | hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', |
| 16533 | hostname: urlParsingNode.hostname, |
| 16534 | port: urlParsingNode.port, |
| 16535 | pathname: (urlParsingNode.pathname.charAt(0) === '/') |
| 16536 | ? urlParsingNode.pathname |
| 16537 | : '/' + urlParsingNode.pathname |
| 16538 | }; |
| 16539 | } |
| 16540 | |
| 16541 | /** |
| 16542 | * Parse a request URL and determine whether this is a same-origin request as the application document. |
no outgoing calls
no test coverage detected