Closed Bug 739805 Opened 12 years ago Closed 12 years ago

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

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 14

People

(Reporter: ttaubert, Assigned: ttaubert)

References

Details

Attachments

(1 file)

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.
Attached patch patch v1Splinter Review
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
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: