5:36 AM 1/27/2019 - 4:02 PM 1/29/2019
This is just a test of some works, worthy to take note of, from:
with Firefox 64 for Windows 7, on 32-bit machine:
with Chrome 71 for Windows 7, on 32-bit machine:
with Internet Explorer 11 for Windows 7, on 32-bit machine:
with Opera 58 for Windows 7, on 32-bit machine:
We surely don't want the worst: green plots (appeared on Firefox, Chrome and Opera).
They represent the Array.prototype.indexOf.call(sel.parentNode.children, sel)
method.
On Internet Explorer however, the worst appears to be the yellow plot which represents the
while(j.previousElementSibling){j = j.previousElementSibling; i++;}
.
So this leaves us the red and blue plots.
As blue seems to be better always than red in all tested browsers, it becomes my preferred choice for getting element child index:
for(i = 0; (j = j.previousElementSibling); i++);
.
I wonder a bit how this all would look... on 64-bit machines?
Comments