Re: CSS, Iframes and ensuring that content is visible

On Mon, Sep 14, 2015 at 11:05 PM, Henrik Andersson
<henke@henke37.cjb.net> wrote:
> I have recently seen a talk about a problem with the web [1] that
> brought up a to me previously unknown issue. The issue is about content
> knowing if it is visible or not. Right now content does not know when it
> is visible. It leads to several problems.
>
> The first problem is performance. Some content is expensive to render.
> While Flash has traditionally been the punching bag in this aspect, it
> is far from the only culprit. Knowing when content isn't visible would
> allow web applications to be good citizens, resulting in far better
> results than any automated solution.
>
> The second problem is measuring impressions. Some content, mainly ads,
> need to know when the user has seen it.
>
> The third problem is a security problem, clickjacking. For all zero of
> you who don't know what clickjacking is, it is when one website embeds
> another in a deceptive way in order to fool the user to interact with
> the embeded content in an unintentional way. Such as pressing buttons
> they didn't mean to.
>
> The speaker shows a POC solution to these problems that involves some
> rather internal knowledge of the user agent implementation (Chrome
> specifically IIRC), but he does not propose any form of API so it is
> hard to judge how it would work on the web.
>
> Can, and most importantly, should, CSS be used to solve this issue?

This is being worked on, just not within the CSSWG:
<https://github.com/slightlyoff/IntersectionObserver/blob/master/explainer.md>.
This is API is designed to solve your first two use-cases, at least.
It might be useful for the third, but it's not intentionally solving
that.

~TJ

Received on Tuesday, 15 September 2015 21:01:55 UTC