Closed Bug 379035 Opened 17 years ago Closed 17 years ago

onKeyUp event of text box generates bogus error regarding a select item in the same form

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 236791

People

(Reporter: atlantisician, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.11) Gecko/20070312 Firefox/1.5.0.11

A form contains a select field and a text input field.  Text field has an onKeyUp trigger: onKeyUp='typeFetch(this)'.  When this event fires it generates an "absurd" error in the Javascript console:
<<<
Error: [Exception... "'Permission denied to set property XULElement.selectedIndex' when calling method: [nsIAutoCompletePopup::selectedIndex]"  nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"  location: "JS frame :: http://localhost:8080/hck/servlet/com.ZType :: typeFetch :: line 98"  data: no]
Source File: http://localhost:8080/hck/servlet/com.ZType
Line: 98
>>>
I suspect that MY onKeyUp function interferes with the one that deals with the select field.  I do NOT see this error in InternetExplorer/ Netscape7.2  ...

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Can you please attach a minimal testcase using the 'Add an attachment' link? Thanks!
The following comment is from the reporter who emailed me directly:

Dear steve.england

I dont want to blame you, but I still cant stand your request, because this bug costed me a day of my life ....
Below the ludicrously simple code::

<soapbox on>
I like to hate the garbage from MS.
I reported earlier a Netscape/ Mozilla/ Firefox bug that has been bothering me for years: when getting out of hibernation these browsers too often go into infinite loops, which has costed me days of my life.  Plenty of others have complained about it.  Nothings gets done about it ...

And consider the horrendous memory leaks in FireFox:  closing tabs/ closing windows does NOT release gobbled up memory ....

Then there is this religion called "open source"/ "extreme programming"/ "agile programming".  All BULL ...

Please have a look at my: Dennis de Champeaux, "Software Engineering Considered Harmful", CACM, vol 45, no 11, pp 102-4, 2002 November.

I suggest that you folks do the right thing:
- Do a clean architecture using OOA/ UML
- Implement the top components in Java so that you get garbage collection for free
- Actually implement everything in Java, profile to identify performance bottlenecks and replace these with tightly controlled C-code <soapbox off>
Have a nice day ....

Here the code:::::

<HTML><HEAD><TITLE>c:/ddc/Html/onkeyup.html</TITLE>
<script language="JavaScript">
function testEvent() {
   alert('whatever');
}
</script>
</HEAD>
<BODY><font Color="#850a0a">
To obtain this <b>STUPID</b> bug:<br>
Type any character in the text box and you find in the javascript
console the error listed below ... UGH
<p>
<FORM>
<select name="symptoms" >
  <option value="ignore">IGNORE</option>
</select>
<p>
<INPUT TYPE="text" NAME="userInput" SIZE="100" VALUE="" onKeyUp='testEvent()' >
</FORM>
<pre>
Error: [Exception... "'Permission denied to set property
XULElement.selectedIndex'
when calling method: [nsIAutoCompletePopup::selectedIndex]"
nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"
location: "JS frame :: file:///C:/ddc/Html/onkeyup.html :: testEvent :: line 4"  data:
no]
Source File: file:///C:/ddc/Html/onkeyup.html
Line: 4
</pre>
This bug is caused when the OK button is released in the alert box
... UGH UGH
</BODY>
</HTML>
This testcase WFM with
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.4pre) Gecko/2007042103 BonEcho/2.0.0.4pre
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a4pre) Gecko/20070427 Minefield/3.0a5pre ID:2007042708 [cairo]
ie: nothing thrown in the error console.
This might be a dupe of bug 236791 (which was fixed in Firefox 2.0 and beyond).
Keywords: testcase
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070422 Minefield/3.0a4pre

WFM on trunk and Firefox 2.0.0.3 on Windows, too. I confirmed that Joey's patch in bug 236791 did indeed fix this. Duping...
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: