mozilla :: #content

20 Mar 2017
14:43catalinbjgraham: If ./mach wpt-manifest-update changes a bunch of hashes not related to my test files, can I commit those as well?
14:53jgrahamcatalinb: Yeah, it likely means someone else didn't update it properly.
17:02dbaronAnybody who could give advice on how to debug why a reported error wouldn't show up in the devtools console? (This is the needinfo? to me in the last comment of , but I'm not particularly knowledgable about it.)
17:02firebotBug 37468 NEW, CSSStyleRule.selectorText setter is not implemented
17:15bzdbaron: Because the devtools console doesn't show CSS errors by default?
17:15bzdbaron: is the first place I'd start
17:21bzdbaron: Also, the patch in the bug is malformed, which makes applying it extra-fun
17:22bzdbaron: So it's hard to test locally and verify whether I'm right
17:22bzdbaron: That said, if ContentParent::RecvScriptError did not get reached, I dunno
17:22bzdbaron: This really should be no different than normal selector parsing failures..
17:23mccr8standups: Bug 1348838 - "verify" IPDL property is broken.
17:23standupsOk, submitted #43938 for
17:23firebot NEW, "verify" IPDL property is broken
17:24mccr8I like how it tweets out a broken. link.
17:28froydnjmccr8: broken ipdl things? never!
17:29mccr8froydnj: some feature we don't actually use in the tree.
17:29mccr8and I failed to fix up an argument when I landed a change, so it broke because dynamic typing.
17:29froydnjmccr8: shocked, I say
17:29mccr8but then I noticed the unit tests were broken for it.
18:57bkellyhmm... are crash rates seem up in the last week
18:59bkellyoh, but its because of beta...
19:36* bkelly really sucks at context switching...
19:37* bkelly gets worse at context switching the more stress there is...
20:14smaugToronto folks: what might be usually the most reliable weather forecast website for Toronto?
20:21* jdm uses
20:31smaugnot very warm yet
20:32bkellyfirst day of spring and there is still a foot of snow in my yard
22:20ron_hi guys, newbie here that needs a bit of help. I make an XHR and want to parse the JSON response, the nsIXMLHTTPRequest::GetResponse seems like it would be able to do that for me according to this
22:20ron_I managed to find it being used here -
22:21ron_Is this how I should go about fetching the JSContext and using GetResponse? Thanks in advance!
22:22bzron_: are you in JS or C++
22:22bzron_: ?
22:23bzOK. So in your case, what does "parse response" mean? Which global should it get parsed in?
22:23ron_the response is quite simple and only contains a few string values
22:23bzThat doesn't matter
22:24bzAs long as the response is not a single string, it will look like a JS object and hence be in some global.
22:24bz(and even a single string would need to be in some zone, of course)
22:24bzWhat do you do with this response once you've parsed it?
22:24ron_to be more specific, a signature we have to verify, a public key, a name, and a challenge (that was signed)
22:26bzSo if you do the GetResponse thing
22:26bzyou get out JS objects
22:26bzAnd then you have to deal with it
22:26bzAre the names of the properties you're going to want to get known?
22:26ron_yes, sorry I should've clarified that I'm not too sure on how to retrieve the JSContext
22:27ron_should I retrieve it like in the second link?
22:27bzIt doesn't matter how you retrieve the _jscontext_.
22:27bzThat's a per-thread singleton.
22:27bzWhat matters is what state it's in.
22:28bzWhat are the actual types of the things you want out of this in the end?
22:28bzIs there a spec that describes this operation?
22:29bzHow important is performance here?
22:29ron_not too important
22:29bzI know I'm not answering the question you actually asked, but that's because I think you asked the wrong question. ;)
22:29ron_page 4 under non-encrypted connections
22:30ron_that's alright, i wasnt really sure what to ask in the first place :P
22:30bzSo what should happen if the response looks like this:
22:30bz{ "name": ["a", "b", "c"], etc }
22:31ron_the spec is pretty rough but name should be a string and we should probably verify that
22:31bzThat makes things a lot more annoying. ;)
22:32ron_all 4 properties should be strings, not arrays or objects
22:33bzSo what you can probably do is something like this.
22:34bzAutoJSAPI jsapi;
22:34bz JSObject* cleanGlobal = SimpleGlobalObject::Create(SimpleGlobalObject::GlobalType::BindingDetail);
22:34bz(we need to come up with a better enum value....
22:34bz if (!cleanGlobal) {
22:34bz // handle failure
22:34bz if (!jsapi.Init(cleanGlobal)) {
22:35bz // handle failure
22:35bz }
22:35bz JSContext* cx =;
22:35bzAnd then do the XHR thing.
22:35bzWith GetResponse.
22:35bzAnd then you get to write JSAPI code to actually get its properties, check their types, etc.
22:36bzYou will probably get it wrong (which is not a comment on you, but on the API), so please make sure someone familiar with JSAPI reviews it...
22:36bzWe should really have something that parses JSON into not-JS-objects. :(
22:37ron_thanks! do you think you could point me to a JSAPI code snippet that does that properly so I have something to follow?
22:52bzone sec
22:52bzron_: and following
22:52bzron_: You'd add isString() checks and whatnot
22:53bz_dinnerron_: in your case you may want to report the exceptions instead of just swallowing them of course
22:53bz_dinnerAnd maybe abort on exception.
22:53bz_dinnerDepending on how important it is that you get the right things out in OOM cases or whatnot
21 Mar 2017
No messages
Last message: 5 days and 12 hours ago