Closed Bug 487922 Opened 15 years ago Closed 15 years ago

Port Bug 485482 [Session Restore should handle invalid XPaths better] to SeaMonkey

Categories

(SeaMonkey :: Session Restore, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.0b1

People

(Reporter: misak.bugzilla, Assigned: misak.bugzilla)

References

Details

Attachments

(1 file)

From description:

If a page of HTML tag soup contains something like <class=text><input
type="text"> session restore will write out an XPath like:
"/HTML/BODY/FORM[@name='bug']/CLASS=TEXT/INPUT", which the restore code doesn't
seem to like too much:

Error: uncaught exception: [Exception... "The expression cannot be converted to
return the specified type."  code: "52" nsresult: "0x805b0034
(NS_ERROR_DOM_TYPE_ERR)"  location:
"file:///Users/jag/Applications/Firefox.app/Contents/MacOS/components/nsSessionStore.js
Line: 2627"]

We shouldn't be writing out invalid XPaths, but this could also be handled by
catching any errors thrown by the parser and just skipping restoring that
control.

Due to the above exception session restore doesn't finish fixing up the form,
and every time the page is reloaded (in this tab) the form will be restored
from the values as stored in sessionstore.js.

To reproduce, either set browser.sessionstore.privacy_level to 0 (don't forget
to reset it when you're done) or put the attached test case on a non https
server; have Firefox when it starts show windows and tabs from last time; and
then:

1) Load the test case
2) Select "Bad" and type something in all three text boxes
3) Quit Firefox
4) Start Firefox

  - the 2nd and 3rd text boxes are empty; at least the 3rd one shouldn't be

5) Select "Ugly" and type something in the empty text boxes
6) Reload the test case

  - it says "Bad"; should be "Ugly"

7) Select "Ugly" again
8) Hard (shift) reload the test case

  - it says "Bad"; should be "Good"
  - the first text box isn't empty


If you check the Error Console you'll notice the above exception for each
reload, indicating that session restore is being triggered when it shouldn't
be.
Attachment #372213 - Flags: superreview?(neil)
Attachment #372213 - Flags: review?(neil)
Attachment #372213 - Flags: superreview?(neil)
Attachment #372213 - Flags: superreview+
Attachment #372213 - Flags: review?(neil)
Attachment #372213 - Flags: review+
Keywords: checkin-needed
Comment on attachment 372213 [details] [diff] [review]
ported patch
[Checkin: Comment 1]


http://hg.mozilla.org/comm-central/rev/0fd0ff623ec3
Attachment #372213 - Attachment description: ported patch → ported patch [Checkin: Comment 1]
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: