Closed Bug 444257 Opened 17 years ago Closed 15 years ago

selectionStart will make the script bug when display:none;

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: tn801534, Unassigned)

Details

(Whiteboard: [CLOSEME 2010-11-01])

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.9) Gecko/2008052906 Firefox/3.0 below is my test each use of selectionStart make the script bug <script language="javascript"> function start(){ document.getElementById('c').innerHTML+="start"; /**/ if(document.getElementById('area').selectionStart===null){ document.getElementById('c').innerHTML+="null"; } if(document.getElementById('area').selectionStart===undefined){ document.getElementById('c').innerHTML+="undefined"; } if(typeof(document.getElementById('area').selectionStart)=='number'){ document.getElementById('c').innerHTML+=document.getElementById('area').selectionStart; } if(document.getElementById('area').selectionStart){ document.getElementById('c').innerHTML+="true"; } if(!document.getElementById('area').selectionStart){ document.getElementById('c').innerHTML+="false"; } document.getElementById('c').innerHTML+="over"; } </script> </head> <body onload="start();"> <div id="c"> </div> <form> <textarea name="area" id="area" rows='25' cols='60' style="display:none;"> </textarea> </form> </body> Reproducible: Always Steps to Reproduce: 1. 2. 3.
Same here. To shorten the code a little bit: <textarea style="display: none;" id="ta" name="test" cols="40" rows="10"></textarea> <a href="javascript:alert(document.getElementById('ta').selectionStart);">ClickMe</a> If I click on the link I get the following exception: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLTextAreaElement.selectionStart]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: javascript:alert(document.getElementById('ta').selectionStart); :: <TOP_LEVEL> :: line 1" data: no] It seems like as soon as the textarea is invisible the selection can't be accessed. My user-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5
This is a mass search for bugs which are in the Firefox General component, are UNCO, have not been changed for 500 days and have an unspecified version. Reporter, can you please update to Firefox 3.6.10 or later, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the issue, please update this bug. If the issue is gone, please set the status to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
No reply from reporter, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.