Loading layout/reftests/css-sizing/min-intrinsic-with-max-width-percents-across-form-controls.html in a debug stylo build leaks. At shutdown we get: ###!!! ASSERTION: 1 dynamic atom(s) with non-zero refcount: anonymous-div: 'nonZeroRefcountAtomsCount == 0', file xpcom/ds/nsAtomTable.cpp, line 411 and Leaked URLs: resource://gre-resources/forms.css Leak log says: |<----------------Class--------------->|<-----Bytes------>|<----Objects---->| | | Per-Inst Leaked| Total Rem| 0 |TOTAL | 41 400| 129448 8| 389 |nsAuthURLParser | 24 24| 2 1| 554 |nsJSPrincipals | 24 24| 228 1| 569 |nsMainThreadPtrHolder<T> | 24 72| 588 3| 641 |nsStandardURL | 264 264| 1659 1| 645 |nsStringBuffer | 8 16| 22103 2|
So at a guess, we are leaking a URLValue. That holds three nsMainThreadPtrHolders (to a principal, base URI, and referrer URI) and a stringbuffer for the url itself. The nsJSPrincipals is the principal we own, presumably we have no referrer, our base URI is resource://gre-resources/forms.css and holds a second stringbuffer.
Minimalish leak testcase: data:text/html,<input%20type=number> I did try logging ctor/dtor for URLValueData and we seem to be destroying all the ones we create... unless servo is creating some directly, not via the Gecko ctor/dtor? Bu I don't think we do that.
A bit more data: 1) If I stop creating the -moz-number-text anonymous <input>, the leak goes away. 2) If I comment out the -moz-binding bit of the "input" styles in forms.css, the leak loses all the URL-related and principal-related stuff but we still leak an nsStrinGbuffer and the anonymous-div atom. Presumably the leaked stringbuffer is the one in the atom. 3) We seem to not leak any nsStyleContext or StyleSheetInfo or URLValueData instances, if I added my CTOR/DTOR logging correctly. Something here is fishy with the pseudo-element bits...
Ok. I'm working on my patches for the pseudo-element bits today, we'll see if the problem persists.
I don't see any leaks on min-intrinsic-with-max-width-percents-across-form-controls.html on today's mozilla-central. As I wrote bug 1321754 comment 48, I think leaks somewhat related to pseudo elements has gone now.
So with the patches in bug 1361235 is this fixed at least in terms of the leak? Can we reenable these tests? Do we need a followup for us not finding these elements to restyle?
The min-intrisic-with-max-width-percents-across-form-controls.html tests have been re-enabled. I'm looking into the underlying issue of not finding these elements in bug 1364361.