Last Comment Bug 739805 - Calling getTabState() on a not-yet-restored tab wipes out text and scroll data
: Calling getTabState() on a not-yet-restored tab wipes out text and scroll data
Status: RESOLVED FIXED
:
Product: Firefox
Classification: Client Software
Component: Session Restore (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 14
Assigned To: Tim Taubert [:ttaubert]
:
Mentors:
: 653958 (view as bug list)
Depends on:
Blocks: 739171
  Show dependency treegraph
 
Reported: 2012-03-27 15:20 PDT by Tim Taubert [:ttaubert]
Modified: 2012-08-29 19:56 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch v1 (4.09 KB, patch)
2012-03-27 15:25 PDT, Tim Taubert [:ttaubert]
paul: review+
Details | Diff | Splinter Review

Description Tim Taubert [:ttaubert] 2012-03-27 15:20:26 PDT
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.
Comment 1 Tim Taubert [:ttaubert] 2012-03-27 15:25:15 PDT
Created attachment 609914 [details] [diff] [review]
patch v1
Comment 2 Paul O'Shannessy [:zpao] (not reading much bugmail, email directly) 2012-03-27 16:07:34 PDT
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.
Comment 3 Tim Taubert [:ttaubert] 2012-03-28 00:15:12 PDT
(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.
Comment 4 Tim Taubert [:ttaubert] 2012-03-28 00:18:33 PDT
https://hg.mozilla.org/integration/fx-team/rev/3c8f6fe5ce4e
Comment 5 Tim Taubert [:ttaubert] 2012-03-29 02:53:38 PDT
https://hg.mozilla.org/mozilla-central/rev/3c8f6fe5ce4e
Comment 6 ithinc 2012-08-29 19:56:22 PDT
*** Bug 653958 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.