Closed Bug 319935 Opened 19 years ago Closed 19 years ago

iframe.contentWindow.focus() on designMode iframe doesn't make caret visible

Categories

(Core :: DOM: Editor, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 306267

People

(Reporter: grig, Assigned: mozeditor)

References

()

Details

(Keywords: regression, testcase)

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 when my HTML editor loads it should focus in an editable area. Actually it does, but cursor is hidden so an user cannot find out what is the currently selected place to type in. Reproducible: Always Steps to Reproduce: To see this bug on the login page please type: - login = admin - password = qwerty - knowledgebase = Demo_for_kern Login into the system. Setup - System(second level tab) - Edit Header Text. The editor opens. It's possible to write some text there, but cursor is absolutely not visible unless an user clicks on editable area.
Version: unspecified → Trunk
Summary: iframe.contentWindow.focus() doesn't work properly → iframe.contentWindow.focus() doesn't make caret visible
I can reproduce the problem on http://www.supportwizard.com:8080/gui2/login.jsp, but it works correctly for me with a simple example. A simple testcase that demonstrates the problem (rather than instructions for using a huge web application that demonstrates the problem) would be helpful.
Summary: iframe.contentWindow.focus() doesn't make caret visible → iframe.contentWindow.focus() on designMode iframe doesn't make caret visible
I'll try to simplify this.
Attached file A bit simpler (obsolete) —
Attachment #205669 - Attachment is obsolete: true
Attached file simple testcase
I think the problem has to do with setting designMode to "on" and then using document.write. (It's not obvious from the original code that this happens, but it does.) The workaround for this bug is to do things in a more sane order, or to use innerHTML instead. It's not obvious to me that designMode should be preserved at all when using document.write to create a new document. In the original, the caret appears after you type a letter, whereas in this testcase, it doesn't appear unless you click. I don't know why this difference exists; hopefully it's the same bug the whole time.
Attachment #205673 - Attachment is obsolete: true
Assignee: nobody → mozeditor
Status: UNCONFIRMED → NEW
Component: General → Editor
Ever confirmed: true
Product: Firefox → Core
QA Contact: general
Version: Trunk → 1.8 Branch
Many thanks for the explanation, the things are getting clearer to me. Then another question is: if document.write() is deprecated why does the browser not report about such wrong usages in log console? Would you add this to the browser code?
Seems to have the same regression range as mentioned in bug 306267.
Keywords: regression, testcase
Blocks: 320355
I'm not saying document.write is deprecated. I'm just saying that setting document.designMode to "on" and *then* using document.write (which creates a *new* document) is a strange way to use document.designMode, and changing the site to use a less strange method is one way to work around the bug in Firefox.
I think this bug affects vBulletin (bug 306267) and netscape.com (bug 320355) in addition to supportwizard.com (this bug). It has confused at least one user to the point that they thought they couldn't compose an email message, until I suggested that they try typing despite not being able to see a caret.
Flags: blocking1.8.0.1?
Looking at the testcase in bug 306267 again, I can see that the testcase here is equivalent. So this is a dup of bug 306267. *** This bug has been marked as a duplicate of 306267 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Flags: blocking1.8.0.1?
Resolution: --- → DUPLICATE
No longer blocks: 320355
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: