Last Comment Bug 265456 - Still possible to focus textbox in background tab, by using createevent
: Still possible to focus textbox in background tab, by using createevent
Status: RESOLVED FIXED
[sg:fix]
: fixed-aviary1.0, fixed1.4.4, fixed1.7.5, testcase
Product: Firefox
Classification: Client Software
Component: Tabbed Browser (show other bugs)
: 1.0 Branch
: x86 All
: -- normal (vote)
: ---
Assigned To: Johnny Stenback (:jst, jst@mozilla.com)
:
Mentors:
data:text/html;charset=utf-8,%3CHTML%...
Depends on: 124750
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-21 08:50 PDT by Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( )
Modified: 2009-09-18 13:20 PDT (History)
15 users (show)
jruderman: blocking‑aviary1.0+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Plug this hole, and a few others too. (6.02 KB, patch)
2004-10-22 11:02 PDT, Johnny Stenback (:jst, jst@mozilla.com)
bryner: review+
bryner: superreview+
asa: approval‑aviary+
Details | Diff | Review

Description Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2004-10-21 08:50:46 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20041020 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20041020 Firefox/1.0

I see that bug 124750 is fixed on the branch.
But it is still possible to focus a textarea in a background tab, see the URL
testcase. It consists of the following code:
<HTML>
<HEAD>
</HEAD>
<BODY>
<label>text<textarea>evil textarea</textarea></label>
<script>
function doe(){
var x=document.getElementsByTagName('label')[0];
var me = document.createEvent("MouseEvents");
me.initMouseEvent('click',1,1,window,0,0,0,0,0,0,0,0,0,0,x);
x.dispatchEvent(me);
}
setInterval('doe()',1000);
</script>
</BODY></HTML>

Reproducible: Always
Steps to Reproduce:
1. Open the url testcase in a background tab
2. Focus a textbox in this page
3.

Actual Results:  
Watch the caret disappear in one second or less

Expected Results:  
The caret should stay in the textbox.
Comment 1 Martijn Wargers [:mwargers] (gone per 2016-05-31 :-( ) 2004-10-22 01:48:48 PDT
Also happens with:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20041021 Firefox/1.0
Comment 2 Bradley Chapman (not reading bugmail, still gone but not forever) 2004-10-22 04:48:55 PDT
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041021 Firefox/1.0
(daihard: P4/SSE2)

This one is especially bad because it KEEPS stealing focus, even after moving
away from the page. Yuck!
Comment 3 Johnny Stenback (:jst, jst@mozilla.com) 2004-10-22 11:02:12 PDT
Created attachment 163039 [details] [diff] [review]
Plug this hole, and a few others too.
Comment 4 Asa Dotzler [:asa] 2004-10-22 11:28:02 PDT
Comment on attachment 163039 [details] [diff] [review]
Plug this hole, and a few others too.

a=asa for aviary checkin.
Comment 5 Johnny Stenback (:jst, jst@mozilla.com) 2004-10-22 12:35:34 PDT
Fixed on the aviary branch.
Comment 6 Tracy Walker [:tracy] 2004-10-26 10:48:11 PDT
evil text area no longer steals focus from other tab/form. as seen on windows
firefox branch build 2004102607
Comment 7 sairuh (rarely reading bugmail) 2004-10-26 10:50:46 PDT
also looks good on linux fc2 2004102609-0.11.
Comment 8 Marcia Knous [:marcia - use ni] 2004-10-26 11:12:21 PDT
looks good on Mac, too using 2004-10-26-06-0.11/
Comment 9 Aaron Slunt 2004-10-27 18:32:40 PDT
Let's not forget (sorry if this was already mentioned) that this affects ALL
input fields.
Comment 10 Johnny Stenback (:jst, jst@mozilla.com) 2004-10-27 19:00:31 PDT
Landed on the 1.7 branch now too (assuming a=dveditz).
Comment 11 Peter van der Woude [:Peter6] 2005-01-12 05:25:36 PST
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a6) Gecko/20050112
Firefox/1.0+

WFM

shouldn't this be RESOLVED/FIXED ?
Comment 12 Daniel Veditz [:dveditz] 2005-01-13 00:34:42 PST
This appears to have landed on the trunk 2004-11-04

Note You need to log in before you can comment on or make changes to this bug.