setDOMElement bug?

I’ve been testing out setDOMElement on a private WPT instance to track when a critical part of the page actually shows up. The times being reported for ‘DOM Element’ appears to be wrong. I can reproduce this on as well, so I’ve data to share.

Check out these test results:

I’m using ‘setDOMElement id=theme__firstscreenshot’ and getting back a time of 11.125s for this particular test. The problem with that number is that the particular DOM element gets added by JavaScript, specifically - themes.db8c639c61d1ce45e6b5.min.js - at 11.125s in the waterfall that JavaScript request hasn’t even returned any data yet.

From the look of things the DOM element gets created before the JavaScript that creates it is even downloaded ( let alone executed ).

In other tests ‘DOM Element’ returns a time where that JavaScript file is still being downloaded. Which is a little different than the test I’ve pointed to, but still confusing in the same way ( DOM element time reports it showing up before the JavaScript that creates it even finishes downloading ).

I’m left to conclude that setDOMElement doesn’t actually work. If I’m wrong please point out what I’m missing.