Dom elements count
|
06-24-2013, 06:04 PM
Post: #1
|
|||
|
|||
Dom elements count
Hello,
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 http://www.webpagetest.org/result/130624_R0_CFP/ while using Google Chrome dev tools and the command document.getElementsByTagName("*").length I got only 1337 elements. What causes this huge difference? Thanks in advance and congrats for the really nice tool! Stefano |
|||
06-26-2013, 04:34 AM
Post: #2
|
|||
|
|||
RE: Dom elements count
That's pretty strange because that's exactly what WebPagetest runs:
https://code.google.com/p/webpagetest/so...ript.js#87 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. |
|||
06-26-2013, 04:00 PM
Post: #3
|
|||
|
|||
RE: Dom elements count
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 http://www.webpagetest.org/result/130626_HQ_868/ Maybe IE9 is computing something different from document.getElementsByTagName("*").length? Hope this helps finding the problem. Thanks again, Stefano |
|||
06-28-2013, 12:42 AM
Post: #4
|
|||
|
|||
RE: Dom elements count
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).
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)