Closed Bug 498630 Opened 15 years ago Closed 15 years ago

when js fired in the frame overwrite itself, no textfields can have the caret

Categories

(Firefox :: General, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: chado_moz, Unassigned)

Details

(Keywords: regression)

Attachments

(2 obsolete files)

User-Agent:       Opera/9.64 (Windows NT 5.1; U; ja) Presto/2.1.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090616 Minefield/3.6a1pre  buildID: 20090616042639

In the frame document, activating the js function that overwrite 
the frame document itself, get lost caret from all textfields 
all over the browser app.  I mean, can not give the caret to 
any textbox or textarea, not only inside content area but also 
other tabs, windows, and even UIs. 


Reproducible: Always

Steps to Reproduce:
0. enable JavaScript.
1. open the testcase.
   same static documents appeare in upper and lower frames.
 (you can jump to step 6)
2. try to give the caret to any textfield. that's ok.
3. click the "write dynamic" link or button inside UPPER frame.
   this fires the js function that overwrite the document 
   in the LOWER frame.
4. try to give the caret to any textfield. that's ok.
5. click the "static doc" link inside lower frame to get back.
6. click the "write dynamic" link or button inside LOWER frame.
   this fires the js function that overwrite the document 
   in the LOWER frame ITSELF.
7. try to give the caret to any textfield. here is the point.

Actual Results:  
no textfield can has caret.

Expected Results:  
any textfield can has caret.

Once caret has gone, the situation carries on until any tab or window 
load some document.  Also, clicking "this doc" or "static doc" link 
in this testcase can get caret back.

repro/non-repro builds I tried:
OK Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1pre) Gecko/20090615 Shiretoko/3.5pre  buildID: 20090615042327
OK Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090609 Minefield/3.6a1pre  buildID: 20090609042626
OK Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090610 Minefield/3.6a1pre  buildID: 20090610042525
NG Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090611 Minefield/3.6a1pre  buildID: 20090611044033
  (snip)
NG Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090616 Minefield/3.6a1pre  buildID: 20090616042639
NG Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2a1pre) Gecko/20090613 Minefield/3.6a1pre  buildID: 20090613031722

focus handling issue ?
Attached file part of testcase (obsolete) —
Keywords: regression
Version: unspecified → Trunk
Attached file testcase (obsolete) —
Comment on attachment 383473 [details]
testcase

><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
><html lang="en"><!-- µµ ʸ»ú¥¨¥ó¥³¡¼¥É¼«Æ°È½Äê¤Î¤¿¤á¤Î¥³¥á¥ó¥È -->
><head>
>  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>  <meta http-equiv="Content-Script-Type" content="text/javascript">
>  <meta http-equiv="Content-Style-Type" content="text/css">
>  <title>frame over-writing</title>
><style type="text/css">frame { margin: 0; padding: 0; }</style>
><script type="text/javascript">
>var	doc_type = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
>var html_lang = 'en';
>var char_set = 'UTF-8';
>var cr = '\n';
>
>var doc_location = 'static.html';
>if ((document.location.hostname.search('bugzilla.mozilla.org') != -1)||(document.location.hostname.search('bugzilla.mozilla.gr.jp') != -1)) {
>	doc_location = 'https://bug498630.bugzilla.mozilla.org/attachment.cgi?id=383470'; /*** modify this for frame location ***/
>}
>
>function write_dynamic() {
>	var d_html = '';
>	d_html = doc_type + cr;
>	d_html += '<html lang="' + html_lang + '">' + cr;
>	d_html += '<head>' + cr;
>	d_html += '    <meta http-equiv="Pragma" content="no-cache">' + cr;
>	d_html += '    <meta http-equiv="Cache-Control" content="no-cache">' + cr;
>	d_html += '    <meta http-equiv="Content-Type" content="text/html\; charset=' + char_set + '"><!-- µµ -->';
>	d_html += '    <meta http-equiv="Content-Style-Type" content="text/css">' + cr;
>	d_html += '<style type="text/css">' + cr;
>	d_html += 'body { color: black\; background: pink\; } .s { font-size: 80%\; }' + cr;
>	d_html += 'div  { margin: 10px\; line-height: 2em\; }' + cr;
>	d_html += '<\/style>' + cr;
>	d_html += '<title>dynamic document<\/title>' + cr;
>	d_html += '<\/head>' + cr;
>	d_html += '<body>' + cr;
>	d_html += 'dynamic document' + cr;
>	d_html += ' <span class="s"> - ' + get_datetime() + '<\/span><hr>' + cr;
>
>	d_html += '<a href="javascript:parent.write_dynamic()\;" title="over-write this doc (href)">over-write this doc<\/a> | ' + cr;
>	d_html += '<input type="button" onclick="parent.write_dynamic()\;"' + cr;
>	d_html += '    value="over-write this doc" title="over-write this doc (onclick)"><br>' + cr;
>
>	d_html += '<div>' + cr;
>	d_html += '<form name="doc_form" action="javascript:void(0)\;" target="_self">textbox: ' + cr;
>	d_html += '	<input type="text" name="text_box" size="30" value="Mozilla">' + cr;
>	d_html += '	<input type="button" value="put &amp\; focus" ' + cr;
>	d_html += '		onclick="document.forms[\'doc_form\'].text_box.value=navigator.product\;document.forms[\'doc_form\'].text_box.focus()\;">' + cr;
>	d_html += '	<br>' + cr;
>	d_html += '	textarea: <textarea name="text_area" cols="40" rows="3">Firefox is free and open source software.<\/textarea>' + cr;
>	d_html += '	<input type="button" value="put &amp\; focus" ' + cr;
>	d_html += '		onclick="document.forms[\'doc_form\'].text_area.value=navigator.userAgent\;document.forms[\'doc_form\'].text_area.focus()\;">' + cr;
>	d_html += '<\/form>' + cr;
>	d_html += '<\/div>' + cr;
>
>	d_html += '<a href="' + doc_location + '">static doc<\/a><br>' + cr;
>
>	d_html += '<\/body>' + cr + '<\/html>' + cr + cr;
>	parent.lower_frmae.document.open();
>	parent.lower_frmae.document.write(d_html);
>	parent.lower_frmae.document.close();
>} // end of func write_dynamic()
>
>
>function get_datetime() {
>	var now = new Date();
>	return now.toLocaleString();
>} // end of func get_datetime();
></script>
></head>
><script type="text/javascript"><!--
>document.writeln('<frameset rows="50%,*">');
>document.writeln('	<frame src="' + doc_location + '" name="upper_frame">');
>document.writeln('	<frame src="' + doc_location + '" name="lower_frmae">');
>document.writeln('<\/frameset>');
>//--></script>
><noscript><body style="color: red; background: black; font-size: 2em;">javascript required.</body></noscript>
><noframes style="color: red; font-size: 2em;">Frames Required.</noframes>
></html>
Forget this, sorry.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
Attachment #383470 - Attachment is obsolete: true
Attachment #383473 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: