https://bugzilla.wikimedia.org/show_bug.cgi?id=49626

       Web browser: ---
            Bug ID: 49626
           Summary: $.makeCollapsible causes memory leaks in all major
                    browsers
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: JavaScript
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: pec...@gmail.com
                CC: krinklem...@gmail.com, tpars...@wikimedia.org
    Classification: Unclassified
   Mobile Platform: ---

I do not know the full scope of this bug, but it occurs reproduceably on
Special:RecentChanges. Below is some reproduce code. It's meant to be tested
via the browser console. As you will see the jQuery cache grows with each
iteration. As there tends to be a lot more than one collapsible section on that
page, the leakage tends to become quite drastic over time, if you run a script
that continuously refreshes the page like this one:

http://dev.wikia.com/wiki/AjaxRC

(function test (t) {
    $('#mw-content-text').empty();

    $(
      '<table class="mw-collapsible mw-collapsed mw-enhanced-rc">\
        <tbody>\
          <tr>\
            <td>\
              <span class="mw-collapsible-toggle">\
                <span class="mw-rc-openarrow">\
                  <a href="#" title="Show details (requires JavaScript)">\
                    <img
src="http://slot1.images.wikia.nocookie.net/__cb62189/common/skins/common/images/Arr_r.png";
width="12" height="12" alt="+" title="Show details (requires JavaScript)">\
                  </a>\
                </span>\
                <span class="mw-rc-closearrow">\
                  <a href="#" title="Hide details">\
                    <img
src="http://slot1.images.wikia.nocookie.net/__cb62189/common/skins/common/images/Arr_d.png";
width="12" height="12" alt="-" title="Hide details">\
                  </a>\
                </span>\
              </span>\
            </td>\
            <td>\
              &nbsp;&nbsp;Test&nbsp;' + t + '&nbsp;&nbsp;</td>\
            <td>\
              <button>reload</button>\
            </td>\
          </tr>\
          <tr><td colspan="3">hidden line</td></tr>\
          <tr><td colspan="3">hidden line</td></tr>\
          <tr><td colspan="3">hidden line</td></tr>\
        </tbody>\
      </table>'
    )
    .appendTo('#mw-content-text')
    .makeCollapsible()
    .find('button')
    .click(function () {
        var c = 0, i;
        for (i in jQuery.cache) c++;
        console.log('Test', t, 'jQuery.cache', c);
        test(t + 1);
    });
}(1));

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to