mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1377772 - URL.searchParams should exist also when nsSimpleURI is used, r=smaug
This commit is contained in:
parent
b25c28477d
commit
e6f301da4a
@ -325,12 +325,9 @@ URLMainThread::UpdateURLSearchParams()
|
||||
}
|
||||
|
||||
nsAutoCString search;
|
||||
nsCOMPtr<nsIURL> url(do_QueryInterface(mURI));
|
||||
if (url) {
|
||||
nsresult rv = url->GetQuery(search);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
search.Truncate();
|
||||
}
|
||||
nsresult rv = mURI->GetQuery(search);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
search.Truncate();
|
||||
}
|
||||
|
||||
mSearchParams->ParseInput(search);
|
||||
|
@ -47,8 +47,14 @@ function testURL() {
|
||||
url.searchParams.set('e', 'f');
|
||||
ok(url.href.indexOf('e=f') != 1, 'URL right');
|
||||
|
||||
|
||||
url = new URL('mailto:a@b.com?subject=Hi');
|
||||
ok(url.searchParams, "URL searchParams exists!");
|
||||
ok(url.searchParams.has('subject'), "Hi");
|
||||
|
||||
runTest();
|
||||
}
|
||||
|
||||
function testParserURLSearchParams() {
|
||||
var checks = [
|
||||
{ input: '', data: {} },
|
||||
|
Loading…
Reference in New Issue
Block a user