What optimizations does the browser perform when the DOM element is displayed from the screen?

I control an iframe that displays in a different domain. Is there a clear way to tell if this iframe is displayed above or below the fold on the parent page? Obviously, I cannot access the parent DOM due to the restriction of the same source .

For example, I tried to measure the rendering speed in a canvas or VML tag, hoping it would be faster if the tag is not on the screen. This did not work - there were no differences in speed. Also for DOM manipulation - there seems to be no way to distinguish between reflow / repaint operations below or above the fold.

How about a flash? I don’t have much experience, but is it possible to check how fast the browser performs flash operations? Or does the flash have any β€œvisible” events outside the DOM standard?

+6
javascript html flash iframe rendering
source share
3 answers

It really depends on the browser, as different browsers interact with the Flash plugin in different ways. The most accurate explanation I could find is the old connectedpixel message.

At the time of writing, Firefox Firefox did not initiate a flash object until it was scrolled to the page. IE, on the other hand, resized the Stage element when it scrolls in the view. No browser, Flash, or OS versions have been set, so this may change after this test.

In short, I need to create a flash object and play with it, watching various events.

0
source share

I do not think so.

The same restriction on the origin policy prevents this, although you can use URL parameters that can be set using javascript that embeds the ad in the offset on the page.

+2
source share

According to Scott Schiller, author of SoundManager2, there is a slight difference in the latency of the JS-> Flash communication bridge, depending on whether the flash movie is enabled on the screen or not. That is, it is slower when it is not on the screen.

+1
source share

All Articles