Closed
Bug 3285
Opened 26 years ago
Closed 26 years ago
[4.xP] indexing into form element to get children
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
M11
People
(Reporter: morse, Assigned: pollmann)
References
()
Details
Attachments
(2 files)
The following content gives the correct value for the alert when run under the
4.5 browser but it gives "undefined" in 5.0. This bug is currently blocking
some of the wallet work.
<HTML>
<HEAD>
<SCRIPT>
title_frame = 0;
list_frame = 1;
function load(){
top.frames[list_frame].document.open();
top.frames[list_frame].document.write(
"<FORM name=fSelectFillin>" +
"<TABLE>" +
"<TR>" +
"<TD>" +
"<SELECT>" +
"<OPTION VALUE=\"X\"> Y </OPTION>" +
"</SELECT><BR>" +
"</TD>" +
"</TR>" +
"</TABLE>" +
"</FORM>"
);
alert(top.frames[list_frame].document.fSelectFillin[0]);
};
</SCRIPT>
</HEAD>
<FRAMESET ROWS = 25,* onLoad=load()>
<FRAME SRC=about:blank
NAME=title_frame
SCROLLING=NO
MARGINWIDTH=1
MARGINHEIGHT=1
NORESIZE>
<FRAME SRC=about:blank
NAME=list_frame
SCROLLING=AUTO
MARGINWIDTH=0
MARGINHEIGHT=0
NORESIZE>
</FRAMESET>
<NOFRAMES>
<BODY> <P> </BODY>
</NOFRAMES>
</HTML>
Comment 1•26 years ago
|
||
My cvs checkout keeps hanging. Will have to get help building.
Reporter | ||
Comment 2•26 years ago
|
||
See bug report 3340 which might be related to this one.
Updated•26 years ago
|
Assignee: norris → vidur
Comment 3•26 years ago
|
||
This is almost certainly in the DOM, not JavaScript.
Updated•26 years ago
|
Assignee: vidur → pollmann
Comment 4•26 years ago
|
||
Eric Pollmann is the right guy for DOM forms related bugs. Eric, Steve Morse is
blocked by this bug.
Assignee | ||
Comment 5•26 years ago
|
||
I'm confused as to what this javascript is supposed to do.
I'll assume that "top.frames[list_frame].document.fSelectFillin[0]" is supposed
to return the first element in the form fSelectFillin, the select element.
Again, according to the DOM spec, you can not index directly into a form element
to access it's children. If, for example, you want to access the select element
you should try this:
top.frames[list_frame].document.fSelectFillin.elements[0]
This works for both 4.5 and 5.0 - is this an acceptable solution for this
problem?
Status: NEW → ASSIGNED
Reporter | ||
Comment 6•26 years ago
|
||
It's an acceptable work-around forme and I am no longer blocked on this one.
But it is not an acceptable solution. Since this was valid in 4.5, there may be
content out on the web that is using it and they will suddenly break when we
roll out 5.0.
Assignee | ||
Updated•26 years ago
|
Severity: major → normal
Summary: javascript gives wrong answer for values in a form → compatibility: indexing into form element to get children
Assignee | ||
Comment 7•26 years ago
|
||
I agree.
At a minimum, we should accept this syntax when in compatibility mode. Marking
this a compatibilty bug.
Comment 8•26 years ago
|
||
per leger, assigning QA contacts to all open bugs without QA contacts according
to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
Comment 10•26 years ago
|
||
QA contact re-assigned according to the product areas we're currently working
on.
Assignee | ||
Updated•26 years ago
|
Target Milestone: M7
Comment 11•26 years ago
|
||
Moving to DOM Level 0 component. Move to DOM Level 1 if that is more correct.
Assignee | ||
Comment 12•26 years ago
|
||
Redistributing bugs...
Updated•26 years ago
|
Summary: compatibility: indexing into form element to get children → [4.xP] indexing into form element to get children
Assignee | ||
Comment 13•26 years ago
|
||
Assignee | ||
Comment 14•26 years ago
|
||
I've got a fix, waiting for the tree to reopen.
Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
OS: Windows NT → All
Hardware: PC → All
Resolution: --- → FIXED
Assignee | ||
Comment 15•26 years ago
|
||
Just checked in a fix.
Updated•26 years ago
|
Status: RESOLVED → REOPENED
Updated•26 years ago
|
Resolution: FIXED → ---
Comment 16•26 years ago
|
||
Eric,
Reopening this bug. Its still returning undefined. Tested with todays builds.
Assignee | ||
Comment 17•26 years ago
|
||
Assignee | ||
Updated•26 years ago
|
Status: REOPENED → RESOLVED
Closed: 26 years ago → 26 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 18•26 years ago
|
||
Hm, my fix works for me... I just attached the original test case. You should
see "[object HTMLSelectElement]" dumped to the console when this page is
loaded. Also check out the "reduced test case", which should have a text
element reading "Bar" - also works for me.
If you are still unable to reproduce the this, can you please me detailed info
on what you are seeing? Thanks!
Updated•26 years ago
|
Status: RESOLVED → VERIFIED
Comment 19•26 years ago
|
||
I can see "[object HTMLSelectElement]" dumped to the console. Marking verified.
You need to log in
before you can comment on or make changes to this bug.
Description
•