Closed Bug 100499 Opened 23 years ago Closed 11 years ago

Setting form control .name leaves control accessible by old name

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: john, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [HAVE FIX])

Attachments

(4 files, 1 obsolete file)

When you set document.mainform.x.name = "y"; and then do
alert(document.mainform.x.name); it will show up as "y".  This means we can
still access the element by its old name.

In the URL, click "name", "(set)", and then "name" again on any of the selects.
 The fact that the "name" succeeds illustrated the problem.
Attached patch Ignore this. (obsolete) (deleted) — Splinter Review
The fix for this is to simply not define form.foo when 'foo' is resolved on the
form, doing that didn't really give us anything since we do the real work in
::GetProperty() in the helper.

jband, sr=?
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: PC → All
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9.5
Hmm, never mind, the attached patch isn't quite right.
Whiteboard: [HAVE FIX]
Attached file testcase attached (deleted) —
Attached file testcase minor correction (deleted) —
Attached patch Better fix. (deleted) — Splinter Review
Whiteboard: [HAVE FIX]
jband, brendan, r/sr=?
Attachment #49884 - Attachment is obsolete: true
Attachment #49884 - Attachment description: Proposed fix. → Ignore this.
before checking in the patch (which looks good), would it be possible to fix the
large comment so that the first sentence is easier to understand (is there a
missing word?) and also the typo fomr->form.
Thanks.
"the form objects prototype chain" needs an apostrophe in "objects".

The MozillaClassic DOM level 0 code took no steps to remove the old name.  Does
IE?  Just curious.

Is there an alternative where you remove the old name in the setter for the name
property?  Might that be simpler (no anti-recursion required)?

/be
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Eh, hmm, ignore the above, wrong bug...
Brendan, looks like IE has the same bug. I'm actually not that worried about
formcontrols being reachable by their old name, but the fact that the old name
will shadow a new form control that is inserted with the old name is
unfortunate. Interestingly enough, IE has the same problem. Given that, I'll
move this to mozilla1.0 and we'll decide what to do later on...
Target Milestone: mozilla0.9.6 → mozilla1.0
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 
(you can query for this string to delete spam or retrieve the list of bugs I've 
moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
Priority: -- → P4
Target Milestone: mozilla1.0.1 → mozilla1.3alpha
Target Milestone: mozilla1.3alpha → mozilla1.3final
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Status: ASSIGNED → NEW
Blocks: 296230
No longer blocks: 296230
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
Blocks: 307415
Assignee: general → nobody
Priority: P4 → --
Target Milestone: mozilla1.3final → ---
Depends on: ParisBindings
Looks like browsers interoperably do this, and the spec requires it.  See the past names map.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Resolution: WONTFIX → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: