aboutsummaryrefslogtreecommitdiffstats
path: root/resources/lib/oojs-ui/oojs-ui.js
diff options
context:
space:
mode:
authorTimo Tijhof <krinklemail@gmail.com>2014-05-30 07:24:27 +0200
committerKrinkle <krinklemail@gmail.com>2014-05-30 05:25:36 +0000
commit25f051d22716dff6788a7154812a7a756429dd36 (patch)
treedd2d19128ac0692f323bb23ad69fd1ead98eec19 /resources/lib/oojs-ui/oojs-ui.js
parent410d531e81108ac3a12edbdb8c1c773c0a581697 (diff)
downloadmediawikicore-25f051d22716dff6788a7154812a7a756429dd36.tar.gz
mediawikicore-25f051d22716dff6788a7154812a7a756429dd36.zip
mediawiki.special.unwatchedPages: Use closest() instead of parents()
Follows-up Ie32cc54abb6f. While it is unlikely that this item will ever end up being nested inside another list, it is semantically incorrect and also quite a bit slower to use parents() here. parents() collects all ancestors between this node and the <html> document element (each and every one of the elements in between), and then, if a selector (e.g. "li") is supplied, it reduces that set to only <li> elements. This can be more than one if your list is a nested list (whether a plain sublist, or perhaps many levels apart, e.g. part of the skin layout or whatever). This one is slower (traverses all the way up) and creates two collections (all ancestors, then filtered down). closest(), as the name implies, always requires a selector and traverses only up to the first match and then returns. This one is faster (traverses only once and not all the way). A 1:1 (closest) vs. a 1:many (parents) relationship. Change-Id: I1cd9a4638285aeab4b5d538072e598601eb475b6
Diffstat (limited to 'resources/lib/oojs-ui/oojs-ui.js')
0 files changed, 0 insertions, 0 deletions