Setting form control .name leaves control accessible by old name

RESOLVED INVALID

Status

()

Core
DOM: Core & HTML
RESOLVED INVALID
16 years ago
4 years ago

People

(Reporter: John Keiser (jkeiser), Unassigned)

Tracking

(Depends on: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [HAVE FIX], URL)

Attachments

(4 attachments, 1 obsolete attachment)

(Reporter)

Description

16 years ago
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.
Created attachment 49884 [details] [diff] [review]
Ignore this.
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.

Updated

16 years ago
Whiteboard: [HAVE FIX]

Comment 4

16 years ago
Created attachment 50331 [details]
testcase attached

Comment 5

16 years ago
Created attachment 50332 [details]
testcase minor correction
Created attachment 50359 [details] [diff] [review]
Better fix.

Updated

16 years ago
Whiteboard: [HAVE FIX]
jband, brendan, r/sr=?

Updated

16 years ago
Attachment #49884 - Attachment is obsolete: true

Updated

16 years ago
Attachment #49884 - Attachment description: Proposed fix. → Ignore this.

Comment 8

16 years ago
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

Updated

16 years ago
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Created attachment 53689 [details] [diff] [review]
Same as above, but should work on AIX too.
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

Comment 13

16 years ago
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

Updated

16 years ago
Priority: -- → P4

Updated

15 years ago
Target Milestone: mozilla1.0.1 → mozilla1.3alpha

Updated

15 years ago
Target Milestone: mozilla1.3alpha → mozilla1.3final
Mass-reassigning bugs.
Assignee: jst → dom_bugs
Status: ASSIGNED → NEW

Updated

12 years ago
Blocks: 296230
No longer blocks: 296230

Updated

9 years ago
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general

Updated

9 years ago
Blocks: 307415
Assignee: general → nobody
Priority: P4 → --
Target Milestone: mozilla1.3final → ---

Updated

5 years ago
Depends on: 580070

Comment 15

4 years ago
Looks like browsers interoperably do this, and the spec requires it.  See the past names map.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX

Updated

4 years ago
Resolution: WONTFIX → INVALID
You need to log in before you can comment on or make changes to this bug.