Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / css / resources / url.js
1 function baseURL() {
2     return window.location.protocol + "//" + window.location.host + window.location.pathname.substr(0, window.location.pathname.lastIndexOf("/") + 1);
3 }
4
5 function absoluteURL(url) {
6     for ( ; ; ) {
7         // Not support "./".
8         var match = url.match(/^(.*\/)[^.][^/]*\/\.\.\/(.*)$/);
9         if (match == null)
10            return url;
11         url = match[1] + match[2];
12     }
13     return url;
14 }