Make sure to restore state on form-less controls correctly. Bug 398243, r+sr+a=jst

This commit is contained in:
bzbarsky@mit.edu 2007-10-02 19:04:59 -07:00
parent 9c4c6d8d45
commit 7b7b0144c8

View File

@ -1756,9 +1756,9 @@ nsContentUtils::GenerateStateKey(nsIContent* aContent,
// Hash by index of control in doc (we are not in a form)
// These are important as they are unique, and type/name may not be.
// Note that we've already flushed content, so there's no
// reason to flush it again.
index = htmlFormControls->IndexOf(aContent, PR_FALSE);
// We have to flush sink notifications at this point to make
// sure that htmlFormControls is up to date.
index = htmlFormControls->IndexOf(aContent, PR_TRUE);
if (index > -1) {
KeyAppendInt(index, aKey);
generatedUniqueKey = PR_TRUE;