When using the COL element within a table definition IE incorrectly
determines the visibility status of child elements when using the focus() and
setActive() methods.
When setting style.display=none on a TR with the table using COL-elements,
IE will set focus on input elements when using the focus methods instead of
throwing an error. The following example shows the correct and incorrect
behavior of focussing:
<html>
<body>
<h3>Incorrect behavior, focussing an invisible element does NOT cause IE to
throw an error</h3>
<table>
<colgroup>
<col width="50">
<col width="*">
</colgroup>
<tr>
<td>input1</td>
<td><input type="text" id="inp1" /></td>
</tr>
<tr id="hiddenTR" style="display:none">
<td>input2</td>
<td><input type="text" id="inp2" /></td>
</tr>
<tr>
<td><input type="button" value="focus1" onclick="inp1.focus();"/></td>
<td><input type="button" value="focus2" onclick="inp2.focus(); alert('We
should have had an exception here. But now you can type in the hidden input
field')" /></td>
</tr>
<tr>
<td><input type="button" value="Show input2"
onclick="hiddenTR.style.display=''" /></td>
<td><input type="button" value="Hide input2"
onclick="hiddenTR.style.display='none'" /></td>
</tr>
</table>
<h3>Correct behavior, focussing an invisible element causes IE to throw an
error</h3>
<table>
<tr>
<td>input1</td>
<td><input type="text" id="inp1Correct" /></td>
</tr>
<tr id="hiddenTRCorrect" style="display:none">
<td>input2</td>
<td><input type="text" id="inp2Correct" /></td>
</tr>
<tr>
<td><input type="button" value="focus1"
onclick="inp1Correct.focus()"/></td>
<td><input type="button" value="focus2"
onclick="inp2Correct.focus();"/></td>
</tr>
<tr>
<td><input type="button" value="Show input2"
onclick="hiddenTRCorrect.style.display=''"/></td>
<td><input type="button" value="Hide input2"
onclick="hiddenTRCorrect.style.display='none'"/></td>
</tr>
</table>
</body>
</html>
Dave Massy [MS] - 15 Apr 2005 00:48 GMT
Hi Nick,
Good chatting to you this morning.
Yes I think this might be a bug. I'll see about getting it entered into our
bug list. I can't guarrantee when we'll get to this though as there is a
clear workaround for web developers adn we have plenty of other work that we
need to get done first at this time. If you have a full scenario as to why
we shoudl attack this issue as a priority that would really help.
Thanks
-Dave
> When using the COL element within a table definition IE incorrectly
> determines the visibility status of child elements when using the focus()
[quoted text clipped - 73 lines]
> </body>
> </html>