Dom elements count


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!


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.

The issue seems to happen with IE9 agent.

If I run the test on 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,


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).