Closed
Bug 690056
Opened 13 years ago
Closed 13 years ago
Implement visibility api
Categories
(Core :: DOM: Core & HTML, defect, P1)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla10
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
()
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 1 obsolete file)
To do it per spec, we need a fix for bug 443316. Do we want to do a moz-prefixed impl with moz-prefixed numeric constants instead for now?
Assignee | ||
Comment 1•13 years ago
|
||
Or we could not have those constants for now; just the two properties. That seems ok to me.
Updated•13 years ago
|
Paul, is there anything else you'd want from bug 674701 after we finish this? I.e. what do you want that Page Visibility doesn't provide, or do you have specific browser bugs in mind with existing Page Visibility implementations that we should avoid here.
Comment 3•13 years ago
|
||
Hi Chris, glad you're asking. Here are the common usecases I want to see covered: - notification when the browser is hidden because of a phone call - notification when the engine is halted (most mobile OS'ses halt the browser threat in some cases) A page can technically be visible but still 'frozen' - easiest example is an alert(). I think window focus events might be enough if implemented correctly to cover this. Does this help?
Keywords: dev-doc-needed
Assignee | ||
Comment 4•13 years ago
|
||
Attachment #563842 -
Flags: review?(jonas)
Assignee | ||
Comment 5•13 years ago
|
||
Attachment #563844 -
Flags: review?(jonas)
Assignee | ||
Updated•13 years ago
|
Attachment #563842 -
Attachment is obsolete: true
Attachment #563842 -
Flags: review?(jonas)
Comment 6•13 years ago
|
||
++bz, this totally rocks
Assignee | ||
Comment 7•13 years ago
|
||
One drawback: when we drop the vendor prefix any content written against this code will break unless it's also checking the non-prefixed bits...
Comment 8•13 years ago
|
||
Are vendor prefixes still considered net positives? See Henri's comment at http://robert.ocallahan.org/2011/09/shifts-in-promoting-open-web.html?showComment=1317367673501#c5792712052968222061 /be
Assignee | ||
Comment 9•13 years ago
|
||
That's a good question, yes. I think Henri's real issue is with the timeframe it takes to get to CR. I fully expect this spec to be in CR within a few months, so that the vendor prefixes will go away then. The benefits of small specs. In the meantime, I made a bunch of implementation calls that the spec does not define yet and I'm not sure about, so I want to prefix just to make sure we don't get locked into those. I _think_ I made the right tradeoffs, but it's not obvious.
Comment on attachment 563844 [details] [diff] [review] Implement a vendor-prefixed version of the visibility API. idea is to fire the visibilitychange event synchronously during pageshow and pagehide, since we're Review of attachment 563844 [details] [diff] [review]: ----------------------------------------------------------------- I'm surprised that only calling PostVisibilityUpdateEvent in one location covers all cases. Does it cover display:none iframes getting hidden? I couldn't see a test for that. Or do we not want to do that yet given the discussion on the mailing list? ::: content/base/src/nsDocument.cpp @@ +8727,5 @@ > +nsDocument::GetVisibilityState() const > +{ > + // We have to check a few pieces of information here: > + // 1) Are we in bfcache (!IsVisible())? If so, nothing else matters; > + // we There seems to be an end to the sentence missing.
Assignee | ||
Comment 11•13 years ago
|
||
> Does it cover display:none iframes getting hidden? No. For now, I'm not doing anything special for display:none iframes, just like other browsers do not. The version of this patch in my tree in fact has a test for that non-specialness. It would be pretty simple to change that if we want, of course. > There seems to be an end to the sentence missing. There should just be a period after "matters" and no trailing "we". Fixed.
Comment on attachment 563844 [details] [diff] [review] Implement a vendor-prefixed version of the visibility API. idea is to fire the visibilitychange event synchronously during pageshow and pagehide, since we're Cool, sounds good with that.
Attachment #563844 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 13•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/c7b4452ef1d2
Flags: in-testsuite+
Priority: -- → P1
Target Milestone: --- → mozilla10
Comment 14•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/c7b4452ef1d2
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 15•11 years ago
|
||
https://developer.mozilla.org/en-US/docs/DOM/Using_the_Page_Visibility_API has existed for a while.
Keywords: dev-doc-needed → dev-doc-complete
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•