Last Comment Bug 100499 - Setting form control .name leaves control accessible by old name
: Setting form control .name leaves control accessible by old name
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Andrew Overholt [:overholt]
Depends on: ParisBindings
Blocks: 307415
  Show dependency treegraph
Reported: 2001-09-19 02:07 PDT by John Keiser (jkeiser)
Modified: 2013-09-06 11:57 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Ignore this. (2.32 KB, patch)
2001-09-19 02:15 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review
testcase attached (371 bytes, text/html)
2001-09-21 15:29 PDT, Sivakiran Tummala
no flags Details
testcase minor correction (398 bytes, text/html)
2001-09-21 15:31 PDT, Sivakiran Tummala
no flags Details
Better fix. (2.68 KB, patch)
2001-09-21 20:33 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review
Same as above, but should work on AIX too. (1.12 KB, patch)
2001-10-15 17:58 PDT, Johnny Stenback (:jst,
no flags Details | Diff | Splinter Review

Description John Keiser (jkeiser) 2001-09-19 02:07:37 PDT
When you set = "y"; and then do
alert(; 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.
Comment 1 Johnny Stenback (:jst, 2001-09-19 02:15:38 PDT
Created attachment 49884 [details] [diff] [review]
Ignore this.
Comment 2 Johnny Stenback (:jst, 2001-09-19 02:19:45 PDT
The fix for this is to simply not define 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=?
Comment 3 Johnny Stenback (:jst, 2001-09-19 02:26:18 PDT
Hmm, never mind, the attached patch isn't quite right.
Comment 4 Sivakiran Tummala 2001-09-21 15:29:27 PDT
Created attachment 50331 [details]
testcase attached
Comment 5 Sivakiran Tummala 2001-09-21 15:31:05 PDT
Created attachment 50332 [details]
testcase minor correction
Comment 6 Johnny Stenback (:jst, 2001-09-21 20:33:42 PDT
Created attachment 50359 [details] [diff] [review]
Better fix.
Comment 7 Johnny Stenback (:jst, 2001-09-21 21:09:24 PDT
jband, brendan, r/sr=?
Comment 8 Fabian Guisset 2001-09-22 05:55:48 PDT
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.
Comment 9 Brendan Eich [:brendan] 2001-09-22 11:52:43 PDT
"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)?

Comment 10 Johnny Stenback (:jst, 2001-10-15 17:58:27 PDT
Created attachment 53689 [details] [diff] [review]
Same as above, but should work on AIX too.
Comment 11 Johnny Stenback (:jst, 2001-10-15 18:02:18 PDT
Eh, hmm, ignore the above, wrong bug...
Comment 12 Johnny Stenback (:jst, 2001-10-18 02:00:43 PDT
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...
Comment 13 Asa Dotzler [:asa] 2001-12-03 11:27:50 PST
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 
Comment 14 Johnny Stenback (:jst, 2003-03-19 12:04:23 PST
Mass-reassigning bugs.
Comment 15 Boris Zbarsky [:bz] (still a bit busy) 2013-09-06 11:54:37 PDT
Looks like browsers interoperably do this, and the spec requires it.  See the past names map.

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