Closed Bug 1069772 Opened 10 years ago Closed 8 years ago

In prerendering, document.visibilityState should returns "prerender".

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: teoli, Assigned: freesamael)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-complete, Whiteboard: btpp-active)

Attachments

(2 files, 7 obsolete files)

document.visibilityState should returns "prerender" when in prerender mode.

According to this, I understand that Chrome supports it: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/TwCghLHBYwA
Assignee: nobody → sawang
Whiteboard: btpp-active
Depends on: 1271240
Attached patch Part 2: Add test case (obsolete) — Splinter Review
Attachment #8751595 - Attachment is obsolete: true
Attachment #8751597 - Attachment is obsolete: true
Attached patch Part 2: Add test case (obsolete) — Splinter Review
Attached patch Part 2: Add test case (obsolete) — Splinter Review
Attachment #8751716 - Attachment is obsolete: true
Attachment #8751717 - Attachment is obsolete: true
Comment on attachment 8752064 [details] [diff] [review]
Part 1: Update document to support prerender visibility state. r=smaug

Hi Olli,

It seems as long as prerender flag is set correctly, it needs only minimal change to nsDocument to support "prerender" visibilityState.

Could you help to review this patch?
Attachment #8752064 - Flags: review?(bugs)
Comment on attachment 8752065 [details] [diff] [review]
Part 2: Add test case

Hi Olli,

The test case tries to verify behaviors based on the description of the latest draft [1]:
> If doc was prerendered and has not previously transitioned to "visible", return "prerender".

It indicates visibilityState should never change back to "prerender" again after active, so the flow tests transition from prerender => visible => hidden => visible on both remote and non-remote browsers.

It also checks hidden attribute should be true when "hidden" or "prerender" [2].

Could you help to review this patch?

[1] https://w3c.github.io/page-visibility/#visibilitystate-attribute
[2] https://w3c.github.io/page-visibility/#hidden-attribute
Attachment #8752065 - Flags: review?(bugs)
Comment on attachment 8752064 [details] [diff] [review]
Part 1: Update document to support prerender visibility state. r=smaug

Not about this bug; just wondering if anyone supports "unloaded" state, and if so, should we too. Perhaps worth to file a bug.
Attachment #8752064 - Flags: review?(bugs) → review+
Attachment #8752065 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #10)
> Comment on attachment 8752064 [details] [diff] [review]
> Part 1: Update document to support prerender visibility state
> 
> Not about this bug; just wondering if anyone supports "unloaded" state, and
> if so, should we too. Perhaps worth to file a bug.

I just noticed the latest draft has removed "unloaded" state, instead it simply uses hidden:
> Return "hidden" if: ... 
> 3. The user agent is to unload doc
ah, that is better. I was looking at some other version then.
Attachment #8752065 - Attachment is obsolete: true
Comment on attachment 8753710 [details] [diff] [review]
Part 2: Add test case. r=smaug

split the test case into 2 so it runs on non-e10s mode
Attachment #8753710 - Attachment description: Part 2: Add test case → Part 2: Add test case. r=smaug
Attachment #8753710 - Flags: review+
Attachment #8752064 - Attachment description: Part 1: Update document to support prerender visibility state → Part 1: Update document to support prerender visibility state. r=smaug
rebase before checkin
Attachment #8752064 - Attachment is obsolete: true
Attachment #8753710 - Attachment is obsolete: true
Attachment #8756233 - Attachment description: Part 2: Add test case → Part 2: Add test case. r=smaug
Attachment #8756233 - Flags: review+
Attachment #8756234 - Attachment description: Part 1: Update document to support prerender visibility state → Part 1: Update document to support prerender visibility state. r=smaug
Attachment #8756234 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/d9b584a14402
https://hg.mozilla.org/mozilla-central/rev/7909d0735869
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Keywords: dev-doc-needed
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: