зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1377772 - URL.searchParams should exist also when nsSimpleURI is used, r=smaug
This commit is contained in:
Родитель
b25c28477d
Коммит
e6f301da4a
|
@ -325,13 +325,10 @@ URLMainThread::UpdateURLSearchParams()
|
|||
}
|
||||
|
||||
nsAutoCString search;
|
||||
nsCOMPtr<nsIURL> url(do_QueryInterface(mURI));
|
||||
if (url) {
|
||||
nsresult rv = url->GetQuery(search);
|
||||
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: {} },
|
||||
|
|
Загрузка…
Ссылка в новой задаче