RE: making page visibility a property of document instead of top level browsing context

I don't understand why display:none styling should be treated more importantly than the other styles I mentioned that cause an element to not be visible to a user. I also think it's unwise to solve only a part of that problem. Why should a display:none iframe report hidden but a below the fold iframe report visible? There is also the compatibility issue.

Can't a developer already just check the styling of their iframes to see if It's been set to display:none? Or is your use case around third party iframes? Feels unlikely that someone would add an ad network to their page and then set those ads to display:none.

I rather we continue the discussion on how can we properly solve this larger problem in Element Visibility. If we find that solution both has no compatibility impact and solves the larger element visibility problem, I think that will just be a greater win for developers. E.g., if I know my Canvas element isn't visible to the user, animations on that Canvas should stop. If we still think we need to make some change in Page Visibility L2, we should pursue a solution that doesn't break compatibility. I rather we articulate our options than rush to the first one.

Thanks,
Jatinder 

-----Original Message-----
From: Jonas Sicking [mailto:jonas@sicking.cc] 
Sent: Monday, January 27, 2014 6:31 PM
To: Jatinder Mann
Cc: Boris Zbarsky; Arvind Jain; Ojan Vafai; public-web-perf@w3.org
Subject: Re: making page visibility a property of document instead of top level browsing context

I continue to think that we should make the document visibility state be affected by display:none on parent <iframe>s.

And using a separate API to measure
visibility-honoring-display-none-iframes from visibility-of-topmost-document seems confusing at best. It seems likewise confusing and error prone to rely on that people will remember to measure visibility of an element rather than the document.

So I definitely think we should make document.visibilityState be "hidden" if any parent iframes are display:none. It seems like the best way to improve performance of the web.

While there is a risk that it will break existing content, the risk seems fairly small.

Obviously that's easy for me to say since I wouldn't be the one attempting such an change. Hence, if it's really the case that no browser is willing to be first to change behavior here then we'll have to live with confusing and less-performant options.

/ Jonas

On Mon, Jan 27, 2014 at 4:57 PM, Jatinder Mann <jmann@microsoft.com> wrote:
> Again, I don't think we should make that particular change, so it's probably not necessary to get that data. I do think we should focus on trying to solve Element Visibility. I'll make sure we include it on the agenda for this week's conference call discussion. It'd be great if you could join us!
>
> -----Original Message-----
> From: Boris Zbarsky [mailto:bzbarsky@MIT.EDU]
> Sent: Monday, January 27, 2014 4:45 PM
> To: Jatinder Mann; Arvind Jain
> Cc: Ojan Vafai; Jonas Sicking; public-web-perf@w3.org
> Subject: Re: making page visibility a property of document instead of 
> top level browsing context
>
> On 1/27/14 4:42 PM, Jatinder Mann wrote:
>> Yes, a change in behavior can be described as breaking compatibility.
>
> Yes.  That's the definition of "breaking compatibility"...
>
>> It's really an example of a change in behavior that would generally be more beneficial (e.g., power savings) than hurtful (e.g., don't expect applications are relying on that behavior).
>
> In other words, you think the compatibility impact is small.  That's a fine thing to think, especially if you have data to back it up.  We need such data here.
>
> -Boris

Received on Tuesday, 28 January 2014 16:46:04 UTC