mozilla :: #content

13 Sep 2017
10:34oddcoderI watched a video about webidl just to make sure I got things right their final goal is to map the C++ implementation to JS interface ?
13:13smaugoddcoder: I'd say the goal with webidl is the describe APIs, and then webidl is also used to generate bindings which map implementation (can be currently C++ or privileged JS) to the JS interface
13:14smaugs/describe/define/
13:20oddcodermmm ok please bear with me ... asssuming I am in here gecko-dev/dom/webidl surfing thorugh interface Document : Node
13:20oddcoderwhere can I find the implementation for that
13:20oddcoderand how are they linked together
13:48jdmoddcoder: the implementation will be somewhere under dom/
13:48jdmin this case, dom/base/nsDocument.cpp
13:48oddcoderyeah that linking should be specified somewhere right, either the file or function names ?
13:48jdmoddcoder: I guess you could try searching for DocumentBinding::Wrap in the code...
13:49oddcoderokay let me see, thanks
13:51oddcoderthere is nothing named like this
13:51oddcoderthere is ImageDocumentBinding::Wrap, HTMLDocumentBinding::Wrap
13:51oddcoderand they are only available in cpp files
13:52jdmright
13:52jdmthe webidl implementation is almost always in c++
13:53jdmthe point is that for a given webidl interface, a [interface]Binding::Wrap function will be generated, and there will be c++ code that calls that function
13:53jdmand that caller is usually the interesting, related code for that interface
13:54jdms/code/file/
13:55asuthhttps://searchfox.org/mozilla-central/source/dom/bindings/Bindings.conf maps interface names to native implementations
13:55asuthNode is less useful at https://searchfox.org/mozilla-central/source/dom/bindings/Bindings.conf#665
13:55jdmohhhh, right
13:55jdmI forgot that gecko leans heavily on that
13:56asuthbut you can searchfox on nsINode https://searchfox.org/mozilla-central/search?q=nsINode
13:56jdmwe removed as much as possible from servo's
13:56oddcoderthanks
13:56oddcoderI will dig into that
13:56jdmhttps://dxr.mozilla.org/servo/source/components/script/dom/bindings/codegen/Bindings.conf?q=path%3Abindings.conf&redirect_type=single
13:57asuthjdm: how is that even possible?! madness!!
13:57jdmasuth: we replaced explicit with implicit, easily-remembers rules :)
13:57jdm*easily-remembered
13:58asuthjdm: not sure if there's sarcasm in there; could the Bindings.conf file describe the rules or link to them for Gecko people's benefit who are trained to consult Bindings.conf?
13:58jdmasuth: yeah, I was just thinking that we should do that
15:07jdmhuh, firefox started pinwheeling and is completely unresponsive now
15:07jdminstruments.app just shows it executing JS
15:16oddcoderwhat is the difference between js and privileged js ?
15:22jdmoddcoder: privileged js can do things that normal websites cannot
15:23oddcoderlike ?
15:23jdmoddcoder: extensions can access the cookie database for any domain, for example
15:23jdmoddcoder: or take screenshots, or make unrestricted network requests, etc.
15:23oddcoderI see
15:24oddcoderfor a moment I thought it can manipulate pointers one way or another thats why I asked
16:02bkellyjdm: do you mind if I throw the necko-like patches in bug 1391693 for review?
16:02firebothttps://bugzil.la/1391693 ASSIGNED, bkelly@mozilla.com consider unifying service worker interception in a SyntheticHttpChannel class
16:02jdmbkelly: sure
16:02bkellyjdm: i think I solved my e10s integration woes... so hopeful I can have cleaned up patches in next couple days
16:02jdmwoo
16:03bkellyI was trying to avoid the nsHttpChannel->InterceptedHttpChannel internal redirect in e10s... but that was a nightmare
16:03bkellyinstead I allow that internal redirect to happen, but I avoid triggering the HttpChannelChild/Parent redirect machinery... I "hide" this interception internal redirect... seems to keep the current set of invariants in place and working
16:04bkellywriting it out sounds scary
16:04* jdm knows that feeling
16:05bkellybut "hiding" the extra internal redirect seems to just let everything work... even diversion "just works"
16:07bkellyjdm: I guess I will flag a necko peer for the changes to HttpBaseChannel
16:08bkellysince they are not directly interception related
16:08* bkelly lunches
17:15bkellya wild memory leak appears
17:20qDotmystor: How are you not a DOM peer yet?
17:20mystorqDot: I've only been here a year and a half
17:21mystorqDot: *shrug*
17:21qDotoddcoder: Are you the oddcoder from radare? :D
17:21oddcoderyup
17:21qDotmystor: Oh, wow, thought you'd been here way longer than that.
17:21mystorqDot: I was an intern a year before that so __kinda__?
17:22mystorIntern 2015 summer, full time May 2016
17:22oddcoderxD
17:22qDotoddcoder: Oh, nice! Thanks for the PIC18 implementation, I'm currently cribbing off of that for a PIC24 core. :)
17:22oddcoder:) have fun
17:22* qDot needs to catch up on r2con talks too.
17:23oddcoderyeah why not xD
17:24mystorsmaug: Who would know about nsIContentIterator and the motivations of the various optimizations the different nsContentIterators make/
17:25oddcoderqDot: is that gsoc/rsoc ?
17:25oddcoderI mean your work related to any of them ?
17:26smaugmystor: last time I looked at that, it is mostly _very_ old code
17:26smaugmystor: is this about the child array stuff?
17:27mystorsmaug: Yeah, nsICOntentIterator uses offsets :-/
17:27smaugmystor: isn't masayuki reviewing catalinb's patches for that
17:28mystorsmaug: I suppose - he'd be the best person then?
17:28smaugwell, I think anyone who is writing code there or reviewing code there needs to read all the relevant code :(
17:28smaugit is old
17:29smaugmystor: I hope we aren't changing any of that before FF57 branching
17:29mystorsmaug: Fair - this is gonna be a fun
17:29mystorsmaug: No no no - I'm explicitly holding off until after 57
18:03florianHi. Who would be willing to do a simple review that requires a DOM peer (touching dom/ipc/ContentPrefs.cpp) in bug 1398198? (I just read in another bug comment that bill is on PTO)
18:03firebothttps://bugzil.la/1398198 ASSIGNED, florian@queze.net browser_startup.js should show the stack when a JS file was loaded earlier than expected
18:05qDotoddcoder: Nah, I just do firmware reversing for fun.
18:06qDotflorian: I can get it.
18:09qDotflorian: Done
18:10florianqDot: thanks! :-)
18:16catalinbmystor: is the problem that nsContentIterator::Init still works with offsets?
18:16oddcoderthere is a way to run firefox in gdb right from mach right ?
18:17mystorcatalinb: Basically - the IME stuff ends up invoking that constructor
18:17oddcoderI can't find it from help
18:17mystorcatalinb: I'm just adding another ::Init which works on RangeBoundaries
18:18qDotoddcoder: ./mach run --debugger
18:18oddcoderthanks
18:18oddcoderusage: mach [global arguments] run [command arguments]
18:18oddcodermach: error: argument --debugger: expected one argument
18:19oddcoderI did something wrong ?
18:19mystorcatalinb: Do you have a different idea?
18:21catalinbmystor: no, I wanted to change the previous constructor which worked on nsRanges, but then masayuki changed it to something that explicitly uses (parent, index) so I thought maybe we don't care about perf there.
18:22oddcodernvm it was --debug instead of --debugger
18:22mystorcatalinb: maybe? It's used by IMEContentObserver at the very least
18:22mystorcatalinb: So it is code which can be run on dom mutations
18:22mystorcatalinb: Which feels perf sensitive to me?
18:23qDotoddcoder: Whoops, sorry, ./mach run --debugger=gdb
18:23qDotOh yeah I use debugger 'cause sometimes I flip between lldb and gdb.
18:24catalinbmystor: yeah, a new constructor should be fine I think
18:35mystorsmaug: Should we be passing down the `aDisconnected` parameter here: http://searchfox.org/mozilla-central/rev/e76c0fee79a34a3612740b33508276f4b37c3ee8/dom/base/nsContentUtils.cpp#2900?
18:36mystorsmaug: Or is ignoring it intentional?
19:37bkellyI like how AWFY speedometer has two Sep 12 days
19:41oddcoderin firefox / gecko what exactly is chrome
19:41oddcoderI see many function that mention chrome
19:41oddcoderI think they doesn't mean the browser do they ?
19:44oddcoder1 more thing what is the difference between nsDocument and nsIDocument ?
19:47jdmoddcoder: chrome is the name for the browser's user interface, to differentiate it from arbitrary web content
19:47jdmnsIDocument is an interface, basically
19:47jdmnsDocument is a concrete implementation of it
19:48oddcoderisn't both in C++ what is the need to have 2 classes that basically represent the same thing ?
19:49oddcoderIf didn't get it wrong there is C++ implementation and C++ interface and on top of the C++ interface there is the webidl bindings that is used to build the JS interface ?
19:51jdmoddcoder: I think there are other classes that inherit from it as well
19:52oddcoderwhich one of the 3 ?
19:52oddcoderwell nvm I get it
19:52jdmok, so there are no other c++ classes besides nsDocument that inherit directly from nsIDocument
19:53jdmit might be used for JS integration, though
19:53jdmI'm not sure
20:11oddcodergdb debugee process exist when I try to debug firefox
20:11oddcoderI tried set follow-exec-mode new and set follow-fork-mode child but no luck
20:12oddcoderalso there is this
20:12oddcoder b nsDocument.cpp:3519
20:12oddcoderNo source file named nsDocument.cpp.
20:12oddcoderI thought it is not loaded yet but it never breaks when I call the function in there via its js interface
20:16bkellyasuth: do you understand the async ipdl returns() stuff?
20:17asuthbkelly: where it returns promises and is the best? Yes, I think so
20:17bkellyasuth: is there any way for me to have the Recv*() method reject the promise?
20:17asuthbkelly: you're not supposed to reject that promise. that's only for IPC to do.
20:17bkelly:-\
20:17asuthbkelly: you need to have semantic rejection happen in-band in your result type
20:18bkellyok, thanks
20:19asuthbkelly: https://searchfox.org/mozilla-central/source/mfbt/Result.h may lessen your pain?
20:19bkellyasuth: of course ErrorResult can't be used here... grrr
20:20asuthbkelly: the quote from kanru's 4/19/2017 post was: "
20:20asuthIt is discouraged for the receiving handler to reject the promise. It
20:20asuthshould be reserved for the IPC system to signal errors. If you must
20:20asuthreject the promise, only PromiseRejectReason::HandlerRejected is valid
20:20asuthvalue."
20:23bkellyasuth: what happens if I call the resolver function after the actor is ActorDestroy()'d?
20:23bkellyany idea?
20:24asuthbkelly: I'd assume the actor cleans out its holders, but it's just an assumption...
20:24bkellyasuth: looks like a reasonable assumption: http://searchfox.org/mozilla-central/source/__GENERATED__/ipc/ipdl/PProfilerChild.cpp#203
20:26asuthah, okay, and it subclasses public SupportsWeakPtr<PProfilerChild>
21:33sheppySo here&#39;s a generic question out of nowhere -- the spec lets you omit the closing tags on many of the elements that comprise a table. What would you consider best practice on that?
21:40sfinkpersonally, I form a firm opinion one way or the other, then every year or two, I flip to the other one and hold it even more firmly
21:40sfinkif only I could remember which one I last ended up on...
21:40sfinkit&#39;s the right one, though, I&#39;m sure of it
21:41sheppysfink: LOL
21:41sheppyMe, I don&#39;t like leaving out the closing pretty much ever unless it&#39;s outright not allowed.
21:41sheppyMakes it easier to remember when to use it and forces me to structure my source cleanly to follow it.
21:42sfinkthat&#39;s normally where I&#39;d be too, but I seem to recall manually editing nested tables and realizing that I was doing a ton of busiwork whenever I wanted to adjust the nesting
21:44sfinkor maybe it was the excessive indenting necessitated by the <tr>\n(indent)<td>\n(indent)(indent)...
21:45sfinkif I don&#39;t have closing tags, I don&#39;t feel compelled to show the structure via newlines and indents
21:45sheppyStuff like this is why I like WYSIWYG tools :D
14 Sep 2017
No messages
   
Last message: 7 days and 5 hours ago