Expose tab.linkedBrowser.__SS_restoreState as a tab attribute to help style unloaded tabs

RESOLVED FIXED in Firefox 9

Status

()

Firefox
Session Restore
--
enhancement
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: ithinc, Assigned: ithinc)

Tracking

(Blocks: 1 bug, {dev-doc-complete})

Trunk
Firefox 9
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

4.54 KB, patch
Details | Diff | Splinter Review
(Assignee)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/6.0
Build ID: 20110811165603

Steps to reproduce:

1. Set browser.sessionstore.max_concurrent_tabs to 0 in about:config
2. Restart Firefox




Expected results:

I want to style the unloaded tabs with a lower opacity. Adding an attribute like "restoring" to reflect __SS_restoreState would help.

Updated

6 years ago
Severity: normal → enhancement
(Assignee)

Comment 1

6 years ago
Created attachment 560710 [details] [diff] [review]
patch
Attachment #560710 - Flags: review?(dietrich)
Comment on attachment 560710 [details] [diff] [review]
patch

looks fine to me, f+. needs a test though. once you have a test for it, ask for final review.
Attachment #560710 - Flags: review?(dietrich) → feedback+
(Assignee)

Comment 3

6 years ago
Is there any guideline to write a testcase? Thanks.
(Assignee)

Comment 4

6 years ago
Created attachment 561507 [details] [diff] [review]
patch v2
Attachment #560710 - Attachment is obsolete: true
Attachment #561507 - Flags: review?(dietrich)
Sorry, I wasn't cc'd on the bug, so didn't see the follow-up comment! For future reference, check out the tests directories where the sessionstore code is - lots of examples there. Though, I presume that's what you did :)
Comment on attachment 561507 [details] [diff] [review]
patch v2

Review of attachment 561507 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/sessionstore/test/browser/browser_682507.js
@@ +4,5 @@
> +function test() {
> +  waitForExplicitFinish();
> +
> +  Services.prefs.setBoolPref("browser.sessionstore.restore_on_demand", true);
> +  gBrowser.addTab("about:mozilla");

looks ok, r=me.

my one concern was that in the case where you actually depend on the web content loading in the tab, you'd want to listen for some event before continuing on with the test. however, in this case, it doesn't really matter.
Attachment #561507 - Flags: review?(dietrich) → review+
Assignee: nobody → ithinc
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(Assignee)

Comment 7

6 years ago
Created attachment 562304 [details] [diff] [review]
patch for checkin
Attachment #561507 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Keywords: checkin-needed

Updated

6 years ago
Flags: in-testsuite+
OS: Windows XP → All
Hardware: x86 → All
Comment on attachment 562304 [details] [diff] [review]
patch for checkin

>+++ b/browser/components/sessionstore/test/browser/browser_682507.js

>+  let ss = Cc['@mozilla.org/browser/sessionstore;1'].getService(Ci.nsISessionStore);

ss should already be available, head.js sets it.

>+  executeSoon(finish);

executeSoon shouldn't be needed here.
In fact, finish should be removed altogether along with waitForExplicitFinish...
https://hg.mozilla.org/integration/mozilla-inbound/rev/e1be3e4479c3
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/e1be3e4479c3
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 9
(Assignee)

Comment 12

6 years ago
(In reply to Dão Gottwald [:dao] from comment #9)
> In fact, finish should be removed altogether along with
> waitForExplicitFinish...

Thanks for the corrections. This is my first testcase.
Keywords: dev-doc-needed
Documented:

https://developer.mozilla.org/en/XUL/Attribute/pending

Updated:

https://developer.mozilla.org/en/Firefox/Updating_add-ons_for_Firefox_9#Theme_changes
https://developer.mozilla.org/en/XUL/tab

And listed on Firefox 9 for developers.
Keywords: dev-doc-needed → dev-doc-complete
(Assignee)

Updated

5 years ago
Blocks: 716279
You need to log in before you can comment on or make changes to this bug.