Auto merge of #22547 - CYBAI:url-tojson, r=emilio

Implement URL's toJSON()

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22544
- [x] There are tests named with `url-tojson` for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22547)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-12-24 09:51:45 -05:00 committed by GitHub
commit f4aafe8caa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 32 deletions

View file

@ -279,4 +279,9 @@ impl URLMethods for URL {
fn SetUsername(&self, value: USVString) {
UrlHelper::SetUsername(&mut self.url.borrow_mut(), value);
}
// https://url.spec.whatwg.org/#dom-url-tojson
fn ToJSON(&self) -> USVString {
self.Href()
}
}

View file

@ -24,6 +24,8 @@ interface URL {
// static DOMString createFor(Blob blob);
static void revokeObjectURL(DOMString url);
USVString toJSON();
// This is only doing as well as gecko right now.
// https://github.com/servo/servo/issues/7590 is on file for
// adding attribute stringifier support.

View file

@ -2,18 +2,9 @@
[idlharness]
expected: FAIL
[URL interface: operation toJSON()]
expected: FAIL
[URLSearchParams interface: operation sort()]
expected: FAIL
[Test toJSON operation of URL]
expected: FAIL
[URL interface: new URL("http://foo") must inherit property "toJSON()" with the proper type]
expected: FAIL
[Testing Symbol.iterator property of iterable interface URLSearchParams]
expected: FAIL
@ -28,18 +19,9 @@
[idlharness]
expected: FAIL
[URL interface: operation toJSON()]
expected: FAIL
[URLSearchParams interface: operation sort()]
expected: FAIL
[Test toJSON operation of URL]
expected: FAIL
[URL interface: new URL("http://foo") must inherit property "toJSON()" with the proper type]
expected: FAIL
[Testing Symbol.iterator property of iterable interface URLSearchParams]
expected: FAIL

View file

@ -1,9 +0,0 @@
[url-tojson.any.html]
[url-tojson]
expected: FAIL
[url-tojson.any.worker.html]
[url-tojson]
expected: FAIL

View file

@ -1,5 +0,0 @@
[url-tojson.html]
type: testharness
[URL's toJSON()]
expected: FAIL