Closed
Bug 542727
Opened 15 years ago
Closed 14 years ago
focus() to an iframe in designmode renders cursor (caret) invisible in FF3.6 only
Categories
(Core :: DOM: Editor, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: cacyclewp, Unassigned)
Details
Attachments
(1 file)
|
705 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
After setting focus to an iframe the cursor is not visible but editing works as usual. This is a new Firefox 3.6 phenomenon, it works fine in older versions and other browsers.
Reproducible: Always
Steps to Reproduce:
1. Run the Wikipedia editor wikEd v0.9.90b as a Greasemonkey script; install from http://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&oldid=340426820&title=User:Cacycle/wikEd.user.js
2. Edit a Wikipedia page
Actual Results:
Cursor is invisible, editing works fine, cursor appears after pushing any of the editing buttons, including [T]
The focus is set with document.getElementById('wikEdFrame').contentWindow.focus(); in line 2834, commenting out this line fixes the problem.
Summary: focus() to an iframe renders cursor invisible in FF3.6 only → focus() to an iframe in designmode renders cursor invisible in FF3.6 only
Adding an alert(0) right before the focus command rescues the cursor. Maybe its timing related?
Updated•15 years ago
|
Component: General → Editor
Product: Firefox → Core
QA Contact: general → editor
Version: unspecified → 1.9.2 Branch
Summary: focus() to an iframe in designmode renders cursor invisible in FF3.6 only → focus() to an iframe in designmode renders cursor (caret) invisible in FF3.6 only
The problem is related to turning designmode on after completing the dynamic frame content insertion using the following onload method:
...<body id="frameBody" onload="window.document.designMode = 'on';">...
This body onload method is needed because older Mozilla versions had a bug that crashed the browser when designmode was turned on too early.
Adding a frameDocument.designMode = 'on'; to the script now brings the caret back in FF3.6 but would crash older FF versions. This is still a bug that should be fixed.
Comment 3•15 years ago
|
||
(In reply to comment #2)
> The problem is related to turning designmode on after completing the dynamic
> frame content insertion using the following onload method:
>
> ...<body id="frameBody" onload="window.document.designMode = 'on';">...
>
> This body onload method is needed because older Mozilla versions had a bug that
> crashed the browser when designmode was turned on too early.
>
> Adding a frameDocument.designMode = 'on'; to the script now brings the caret
> back in FF3.6 but would crash older FF versions. This is still a bug that
> should be fixed.
Which earlier versions of FF are affected? Any relevant bug reports? I've done some searching around, but without finding any good results...
Comment 4•15 years ago
|
||
This is code that used to work just fine until FF 3.6.x, it brought up the caret correctly. Now it doesn't.
Comment 5•15 years ago
|
||
In this file I've included three test cases, after posting my issue on a forum and reading Cacycles Comment 2.
http://dangent.dk/php/testcaret.html
It seems that it's possible to put focus on an Iframe at OnClick, but only if DesignMode has already been set before, eg. at OnLoad or a previous OnClick. This used to work fine in FF 3.5.x.
Hope this helps anyone either to work around or to fix the issue.
I an writing a html editor. I met this problem too. I am so glad that I find a way to resolve this problem this morning.
Before focus to the iframe or you can setTimeout to do the follow actions after the editor is initialized.
1.create a temporary input.
<input type="text" value="v" style="width:0;height:0;border:0;padding:0;margin:0;" />
2.append the temporary input to a visible container.
3.set focus to the input and select the text content in the input.
4.set focus to the iframe.
5.remove the temporary input.
Select the input text is the core action.
I do these actions use jQuery, It's very easy.
Hope this helps, my english is not so ok.
Comment 7•14 years ago
|
||
This works for me on the latest trunk version.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•