Calling getTabState() on a not-yet-restored tab wipes out text and scroll data

RESOLVED FIXED in Firefox 14

Status

()

Firefox
Session Restore
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: ttaubert, Assigned: ttaubert)

Tracking

Trunk
Firefox 14
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Calling getTabState() on a tab that is restoring or waits to be restored wipes out text and scroll data contained in the tab state. _updateTextAndScrollDataForTab() shouldn't really do anything when the tab isn't restored, yet.
Created attachment 609914 [details] [diff] [review]
patch v1
Attachment #609914 - Flags: review?(paul)
Comment on attachment 609914 [details] [diff] [review]
patch v1

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

I may have gotten a bit picky about the test, but I want to make sure it tests the right thing! Fix or let me know it's fine as is.

::: browser/components/sessionstore/test/browser_739805.js
@@ +15,5 @@
> +  whenBrowserLoaded(browser, function () {
> +    whenTabRestored(tab, function () {
> +      let input = browser.contentDocument.getElementById("foo");
> +      is(input.value, "bar", "formdata has been restored correctly");
> +      finish();

Will we ever get to here before the checks below are run? setTabState goes pretty directly to loading a tab (unless restore on demand).

Perhaps it would be more explicit if we ensure tab isn't selected, restore_on_demand is on, doing the checks, then selecting & checking the form value.
Attachment #609914 - Flags: review?(paul) → review+
(In reply to Paul O'Shannessy [:zpao] from comment #2)
> Perhaps it would be more explicit if we ensure tab isn't selected,
> restore_on_demand is on, doing the checks, then selecting & checking the
> form value.

Yeah, that seems better to me as well. Fixed the test to match your suggestion.
https://hg.mozilla.org/integration/fx-team/rev/3c8f6fe5ce4e
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 14
https://hg.mozilla.org/mozilla-central/rev/3c8f6fe5ce4e
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]

Updated

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