(bug 35658) make mw.Uri handle uris w/o protocol or host
authorlupo <lupo.bugzilla@gmail.com>
Sat, 7 Apr 2012 16:52:02 +0000 (18:52 +0200)
committerlupo <lupo.bugzilla@gmail.com>
Sat, 7 Apr 2012 16:52:02 +0000 (18:52 +0200)
commit2d84f3191a9ebf18bcc1b833fd6b7d3666f91f8e
tree79a0550bc3248f47fa4ab028d3166e131f57b67a
parent7727f6633289f63e948c7dbe877d7f290398c472
(bug 35658) make mw.Uri handle uris w/o protocol or host

Includes testcase.

mw.Uri already supplied the protocol if it was missing and
document.location was set. Newly it also supplies the host (and port)
from document.location if that is set. That enables handling of
root-relative URls like "/some/path".

Changeset 2/3: rename test file from mediaWiki.Uri.test.js to
mediawiki.Uri.test.js.

Changeset 4: fix jasmine tests. Test for 'http:/foo.com' is now expected
to succeed, not throw an exception. The second test for
'foo.com/bar/baz' in strict mode is correct; that's parsed in strict
mode as a truly relative path.

Change-Id: Ibc4386ba40cffea9d30417ec2720114f6819ae1c
resources/mediawiki/mediawiki.Uri.js
tests/jasmine/spec/mediawiki.Uri.spec.js
tests/qunit/QUnitTestResources.php
tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js [new file with mode: 0644]