On 7/12/19 1:57 AM, mcace...@mozilla.com wrote:
Do we have an equivalent in Gecko?

No, but it would no be a bad idea to add something...

Right now, in Gecko, I'm having to do this:

Yeah, that's kinda ugly...

     rv = NS_NewURI(getter_AddRefs(resolvedUri), aData.mUrl.Value(), nullptr,
                    doc->GetDocumentURI(), nsContentUtils::GetIOService());

You could simplify this a bit by calling nsContentUtils::ewURIWithDocumentCharset, but that doesn't solve most of the issue.

Also, this clearly shows that our current setup is too easy to mess up: per spec this should be using the document's base URI, not the document's URI, as the base URI.

Also, having to use `nsIURI` feels kinda sad when we implement the URL 
Standard.... Can we use URL  somehow be used as a drop in replacement for 
nsIURI?

Just to be clear, our URL Standard impl will swallow some of those errors this code is checking for and just return empty strings if they happen. And of course it uses nsIURI under the hood.

Past that, it doesn't really have a nicer API (from C++) than nsIURI does, right?

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to