Closed Bug 288106 Opened 20 years ago Closed 14 years ago

When typing something on IFrame contentWindow with designMode=on, it opens Firefox Find toolbar (same like hitting Ctrl+F) instead of entering the typed character into the IFrame contentWindow

Categories

(Core :: DOM: Editor, defect)

All
Linux
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: jery_wang2002, Unassigned)

References

Details

(Keywords: testcase)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050328 Firefox/1.0 (Ubuntu package 1.0.2)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050328 Firefox/1.0 (Ubuntu package 1.0.2)

The code:

.....

<iframe 
	id="idHTMLEditor" src="http://mail.yahoo.com"
	style="
	display: block; 
	overflow: auto;
	margin: 0px;
	border: 0px;
	padding: 0px;"></iframe>

......


<script language="javascript">
window.onload = function() {
	var oHTMLEditor;
	
	oHTMLEditor = document.getElementById("idHTMLEditor");
	oHTMLEditor.contentWindow.document.designMode = "on";    
}
</script>

--------------------------------------------

After the yahoo mail frontpage is loaded, try to type a character somewhere.
Instead of entering the character into the page, it pops up the Find toolbar at
the bottom.

Reproducible: Always

Steps to Reproduce:
1. Create a page that contains IFRAME with src="http://mail.yahoo.com"
2. Create javascript inside the page with window.onload = function() { // That
changes the designMode of the mentioned IFrame to ON 
3. Try to type something inside the IFrame content
4. The browser pops up Find toolbar instead of entering the typed character

Actual Results:  
The browser pops up Find toolbar instead of entering the typed character

Expected Results:  
Typed character should appear.
what version of composer were you using? (composer is not part of firefox)
with composer from linux suite trunk 2005040105, the JS you provided does not
enable designMode.
Summary: When typing something on IFrame contentWindow with designMode=on, it opens Firefox Find toolbar (same like hitting Ctrl+F) instead of entering the typed character into the IFrame contentWindow → When typing something on IFrame contentWindow with designMode=on, it opens Firefox Find toolbar (same like hitting Ctrl+F) instead of entering the typed character into the IFrame contentWindow
(In reply to comment #1)
> what version of composer were you using? (composer is not part of firefox)
> with composer from linux suite trunk 2005040105, the JS you provided does not
> enable designMode.

Try this (according to http://www.mozilla.org/editor/midasdemo/). This works fine:

<html>
<head>
<title>Testing designMode in Firefox</title>

</head>
<body>
Testing IFrame:
<iframe id="idHTMLEditor" style="
	display: block; 
	overflow: auto;"></iframe>


<script language="javascript" type="text/javascript">
window.onload = function() {
	var oHTMLEditor;
	oHTMLEditor = document.getElementById("idHTMLEditor");
	oHTMLEditor.contentWindow.document.designMode = "on";    

	oHTMLEditor.height = 600;
	oHTMLEditor.width = 800;
}
</script>

</body>
</html>


---------------------------------------

But when I define iframe's src, it opens Find bar when I type something on the
iframe document:

<html>
<head>
<title>Testing designMode in Firefox</title>

</head>
<body>
Testing IFrame:
<iframe id="idHTMLEditor" style="
	display: block; 
	overflow: auto;" src="http://www.mozilla.org/"></iframe>


<script language="javascript" type="text/javascript">
window.onload = function() {
	var oHTMLEditor;
	oHTMLEditor = document.getElementById("idHTMLEditor");
	oHTMLEditor.contentWindow.document.designMode = "on";    

	oHTMLEditor.height = 600;
	oHTMLEditor.width = 800;
}
</script>

</body>
</html>


----------------------
Actually

the last two commands:
	oHTMLEditor.height = 600;
	oHTMLEditor.width = 800;
were not executed. 

And, oHTMLEditor.contentWindow.document.designMode is undefined when Iframe's
src is defined.

Is this by design?
> 
> ----------------------
> Actually
> 
> the last two commands:
> 	oHTMLEditor.height = 600;
> 	oHTMLEditor.width = 800;
> were not executed. 
> 
> And, oHTMLEditor.contentWindow.document.designMode is undefined when Iframe's
> src is defined.
> 
> Is this by design?


FYI, In IE, the edit mode (designMode) is fine even when IFrame's src is predefined.
ok, this is editor, not composer.  I can reproduce the bug with linux trunk
2005040201.

JS Console says:
Error: uncaught exception: Permission denied to set property HTMLDocument.designMode

==> editor
Assignee: composer → mozeditor
Status: UNCONFIRMED → NEW
Component: Composer → Editor
Ever confirmed: true
Keywords: testcase
Product: Mozilla Application Suite → Core
QA Contact: bugzilla
Version: unspecified → Trunk
(In reply to comment #4)
> ok, this is editor, not composer.  I can reproduce the bug with linux trunk
> 2005040201.
> 
> JS Console says:
> Error: uncaught exception: Permission denied to set property
HTMLDocument.designMode
> 
> ==> editor

To add, this problem arises when the IFrame's src is predefined. Meaning
designMode='on' is only allowed when IFrame's src is not defined (no src
attribute in IFrame).

I used the Linux version downloaded the latest through Ubuntu Hoary
(mozilla-firefox 1.0.2). I guess the Windows version should exhibit the same
problem.
You can't set the designmode on document that are on a different domain. It seems that is what you are trying to do with your testcase, not?
QA Contact: bugzilla → editor
Assignee: mozeditor → nobody
Blocks: 424615
INVALID per comment 6. This fails on all browsers.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.