Loading dom/url/URL.h +6 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,12 @@ public: GetHref(aRetval, aRv); } void ToJSON(nsAString& aResult, ErrorResult& aRv) const { GetHref(aResult, aRv); } // URLSearchParamsObserver void URLSearchParamsUpdated(URLSearchParams* aSearchParams) override; Loading dom/url/tests/test_url.html +6 −0 Original line number Diff line number Diff line Loading @@ -450,5 +450,11 @@ url = new URL("data:text/html,<a href=\"http://example.org/?q\">Link</a>"); is(url.href, "data:text/html,<a%20href=\"http://example.org/?q\">Link</a>"); </script> <script> var u = new URL('http://www.example.org'); ok(u.toJSON(), 'http://www.example.org', "URL.toJSON()"); is(JSON.stringify(u), "\"http://www.example.org/\"", "JSON.stringify(u) works"); </script> </body> </html> dom/webidl/URL.webidl +4 −1 Original line number Diff line number Diff line Loading @@ -44,9 +44,12 @@ interface URL { attribute USVString pathname; [Throws] attribute USVString search; readonly attribute URLSearchParams searchParams; [SameObject] readonly attribute URLSearchParams searchParams; [Throws] attribute USVString hash; [Throws] USVString toJSON(); }; partial interface URL { Loading Loading
dom/url/URL.h +6 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,12 @@ public: GetHref(aRetval, aRv); } void ToJSON(nsAString& aResult, ErrorResult& aRv) const { GetHref(aResult, aRv); } // URLSearchParamsObserver void URLSearchParamsUpdated(URLSearchParams* aSearchParams) override; Loading
dom/url/tests/test_url.html +6 −0 Original line number Diff line number Diff line Loading @@ -450,5 +450,11 @@ url = new URL("data:text/html,<a href=\"http://example.org/?q\">Link</a>"); is(url.href, "data:text/html,<a%20href=\"http://example.org/?q\">Link</a>"); </script> <script> var u = new URL('http://www.example.org'); ok(u.toJSON(), 'http://www.example.org', "URL.toJSON()"); is(JSON.stringify(u), "\"http://www.example.org/\"", "JSON.stringify(u) works"); </script> </body> </html>
dom/webidl/URL.webidl +4 −1 Original line number Diff line number Diff line Loading @@ -44,9 +44,12 @@ interface URL { attribute USVString pathname; [Throws] attribute USVString search; readonly attribute URLSearchParams searchParams; [SameObject] readonly attribute URLSearchParams searchParams; [Throws] attribute USVString hash; [Throws] USVString toJSON(); }; partial interface URL { Loading