WebPagetest Forums
Dom elements count - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: Dom elements count (/showthread.php?tid=12353)

Dom elements count - ninjaste - 06-24-2013 06:04 PM


I'm using webpagetest for some testing, and I'm comparing it with Chrome dev tools.
There is a thing I don't understand, the dom elements metric given by webpagetest on a web site I have tested recently tells me 3060 DOM elements, see test result


while using Google Chrome dev tools and the command


I got only 1337 elements.
What causes this huge difference?

Thanks in advance and congrats for the really nice tool!


RE: Dom elements count - pmeenan - 06-26-2013 04:34 AM

That's pretty strange because that's exactly what WebPagetest runs:


I'll take a look and see if anything jumps out at me but I don't have a good explanation unless it is something platform-specific or the content was a bit different.

RE: Dom elements count - ninjaste - 06-26-2013 04:00 PM

The issue seems to happen with IE9 agent.

If I run the test on http://www.lancia.it with Chrome or Firefox agent, the DOM count is correct (same as document.getElementsByTagName("*").length )

But if I run the test with IE9, then I get too much DOM elements


Maybe IE9 is computing something different from document.getElementsByTagName("*").length?

Hope this helps finding the problem.

Thanks again,


RE: Dom elements count - pmeenan - 06-28-2013 12:42 AM

Yes, unloke the other browsers, the IE agent can walk into cross-domain iframes and count the DOM elements inside of them as well. I'm fairly confident that there is no double-counting going on (but I'll verify) but the difference should come from any iframes on the page (the social stuff at the bottom of your page are all in cross-domain iframes).