| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-pathname"> | 2 <link rel="help" href="http://url.spec.whatwg.org/#dom-url-pathname"> |
| 3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 test(function() { | 7 test(function() { |
| 8 var url = new URL('http://www.domain.com/'); | 8 var url = new URL('http://www.domain.com/'); |
| 9 assert_equals(url.pathname, '/'); | 9 assert_equals(url.pathname, '/'); |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 test(function() { | 44 test(function() { |
| 45 var url = new URL('http://abc.de:8080/path/file?query#fragment'); | 45 var url = new URL('http://abc.de:8080/path/file?query#fragment'); |
| 46 url.href = 'invalid'; | 46 url.href = 'invalid'; |
| 47 assert_equals(url.pathname, ''); | 47 assert_equals(url.pathname, ''); |
| 48 | 48 |
| 49 url.pathname = '/new/path'; | 49 url.pathname = '/new/path'; |
| 50 assert_equals(url.pathname, ''); | 50 assert_equals(url.pathname, ''); |
| 51 assert_equals(url.href, 'invalid'); | 51 assert_equals(url.href, 'invalid'); |
| 52 }, 'pathname property invalid URL'); | 52 }, 'pathname property invalid URL'); |
| 53 | 53 |
| 54 test(function() { |
| 55 var url = new URL('http://www.domain.com/'); |
| 56 assert_equals(url.pathname, '/'); |
| 57 |
| 58 url.pathname = '\udc01\ud802a'; |
| 59 assert_equals(url.pathname, '/' + encodeURIComponent('\ufffd\ufffda')); |
| 60 }, 'pathname with unmatched surrogates'); |
| 61 |
| 54 </script> | 62 </script> |
| OLD | NEW |