Closed
Bug 311507
Opened 20 years ago
Closed 12 years ago
form state incorrect after minor DOM change and reload
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: desire2learn, Assigned: almasry.mina)
References
(Blocks 1 open bug)
Details
(Keywords: testcase)
Attachments
(1 file)
592 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Using the example HTML below, you can easily reproduce this bug. It occurs with
all form elements, but this example uses radio buttons. When a form element is
removed from the DOM and the page is reloaded, the state of all the form
elements on the page is off by one. In the case of the radio buttons in this
example, the radio button that is "checked" changes (moves up) each time.
<html>
<head>
<script>
function Body_Load() {
var holder = document.getElementById( "testdiv" );
var item = document.getElementById( "inputthing" );
holder.removeChild( item );
}
</script>
</head>
<body onload="Body_Load();">
<form>
<div id="testdiv">
<input type=input value=boo id="inputthing">
</div>
<input type="radio" name="test" value="1">
<input type="radio" name="test" value="2">
<input type="radio" name="test" value="3">
<input type="radio" name="test" value="4">
</form>
</body>
</html>
Reproducible: Always
Steps to Reproduce:
1. Load the above example.
2. Select the last radio button (or any of them).
3. Reload the page.
Actual Results:
The radio button which was checked is no longer checked. Instead, the form
element that appears before it in the DOM receives its state. The same behaviour
occurs with checkboxes, edits, etc.
Expected Results:
The radio button which was selected should still be selected after the page reloads.
![]() |
||
Updated•20 years ago
|
Whiteboard: DUPEME
Comment 2•18 years ago
|
||
Comment 3•18 years ago
|
||
This seems basically the same problem as bug 140697, marking a dependency for now.
Component: History: Session → Document Navigation
QA Contact: history.session → docshell
Updated•16 years ago
|
Target Milestone: --- → mozilla2.0
Updated•16 years ago
|
Target Milestone: mozilla2.0 → ---
![]() |
||
Comment 9•15 years ago
|
||
So it seems like we could fix this in GenerateStateKey by using the control name followed by the control's index in form.elements[name] as needed instead of the control's name in the form followed by the control name, no? Jonas, smaug, do you see any obvious problems with that?
Whiteboard: DUPEME
![]() |
||
Comment 10•14 years ago
|
||
Bug 660549 has more discussion on this. Long story short, we should be generating the same state key at the same time for both save and restore, which means generating the key during pageload, which is when restore happens.
Depends on: 660549
Assignee | ||
Comment 11•12 years ago
|
||
The attached test case WFM. Might have been fixed with bug 737851
![]() |
||
Comment 12•12 years ago
|
||
Yes. This got fixed on the day bug 737851 landed.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Assignee: nobody → malmasry
Target Milestone: --- → mozilla25
You need to log in
before you can comment on or make changes to this bug.
Description
•