Skip to content

Conversation

@dmethvin
Copy link
Member

Fixes #292

This seems like the easiest way to avoid the spurious error. There's no change to the tests because the current tests fire as they did before, the document isn't hidden. The test is already skipped for IE9 but if it wasn't then document.hidden would be falsy there anyway.

In the latest spec it looks like document.hidden has been somewhat obsoleted but is still supported.

@mgol
Copy link
Member

mgol commented Mar 22, 2018

The spec mentions visibilityState as a replacement. It has a pretty good browser support, but, alas, it starts at IE 10 so we'd need a fallback anyway.

On the other hand, I'd rather avoid us preventing the document.hidden removal because we used it not as a fallback... But if we changed that we'd need to change Core as well (cc @markelog, what do you think?).

@mgol
Copy link
Member

mgol commented Mar 22, 2018

Wait, document.hidden is only supported in IE 10+ as well: https://developer.mozilla.org/en-US/docs/Web/API/Document/hidden. Perhaps we should just switch to document.visibilityState everywhere?

@dmethvin
Copy link
Member Author

We could switch I suppose. Most likely document.hidden will stay around forever. I'll create a ticket in core, Migrate should follow whatever we decide to do but I'll land this in the meantime.

Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@markelog
Copy link
Member

Mm, my understanding that if document is hidden we still use this property, is there intention to replace such logic?

@mgol
Copy link
Member

mgol commented Mar 22, 2018

@markelog The issue is document.hidden is deprecated in favor of document.visibilityState and we should avoid deprecated APIs, especially when they have a replacement. Unfortunately, it seems IE doesn't support the new API.

@markelog
Copy link
Member

markelog commented Mar 22, 2018

@markelog The issue is document.hidden is deprecated in favor of document.visibilityState and we should avoid deprecated APIs, especially when they have a replacement. Unfortunately, it seems IE doesn't support the new API.

That's not what I meant :).

I am talking about jQuery.fx.interval, with that prism my previous comment should be a bit more clear I suppose :)

@markelog
Copy link
Member

Okay, I see your point here – #292 (comment)

I think we might want to show the warning only when this property is set – not on the getter

@mgol
Copy link
Member

mgol commented Mar 23, 2018

@markelog That's one solution but a warning for the getter makes sense as well as we don't want people to rely on this value.

@markelog
Copy link
Member

We used as a getter, it still has fully legitimated use, but one might argue that should not be changed, that's how I see it.

But of course you can do whatever you want here :)

@dmethvin
Copy link
Member Author

I'm going to keep the getter in case someone happens to read it in their own code. Our helpful friends at StackOverflow (😭) often seem to think it will fix some problem or another, although most involve assigning some horribly large or small value.

https://stackoverflow.com/search?q=jquery.fx.interval

@markelog
Copy link
Member

Our helpful friends at StackOverflow (😭) often seem to think it will fix some problem or another, although most involve assigning some horribly large or small value.

That's an explanation to keep the setter? Well, whatever, forget it, I don't want to argue about it

@dmethvin
Copy link
Member Author

@markelog not arguing at all, just letting you know that I wanted to keep the getter. This PR will eliminate the false positive for now and we can change core later.

@dmethvin
Copy link
Member Author

Landed at 758a138

@dmethvin dmethvin closed this Mar 23, 2018
@dmethvin dmethvin deleted the 292-interval branch May 27, 2019 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants