Opened 13 years ago

Closed 12 years ago

#1301 closed defect (duplicate)

Editor2 designMode="On" fails in hidden Editor2 Componente Firefox

Reported by: tjerk@… Owned by: alex
Priority: high Milestone: 1.1
Component: Editor Version: 0.3
Keywords: Editor2 designMode firefox Cc:
Blocked By: Blocking:

Description (last modified by Adam Peller)

When using the Editor2 Component on a element (example: <textarea>) that is currently hidden ( for example: behind a tab) firefox will throw an exception (i added some enters for readability):

uncaught exception:
[
Exception... "Component returned failure code: 0x80040111
(NS_ERROR_NOT_AVAILABLE)
[nsIDOMNSHTMLDocument.designMode]" nsresult: "0x80040111
(NS_ERROR_NOT_AVAILABLE)"
location: "JS frame :: 
http://domainname.com/dojo/src/widget/templates/richtextframe.html#
:: init :: line 9" data: no
]

I think it is a bug in the firefox designmode. Anyways the workaround is very simple... Change the javascriptcode in richtextframe.html to the following:

<script type="text/javascript">
function init(){
	 var parentPageDomain = document.location.href.split('#')[1];
	 if (parentPageDomain) {
			document.domain = parentPageDomain;
	 }
}
window.onload = init;
window.onfocus = function() {
	document.designMode = 'On';
}
</script>

Now designmode will only be toggled when the editor-page gets focus, and a page only gets focus when it is visible. Problem solved!

Change History (13)

comment:1 Changed 13 years ago by liucougar

Owner: changed from bill to liucougar

comment:2 Changed 13 years ago by dylan

Milestone: 0.5

comment:3 Changed 13 years ago by liucougar

Milestone: 0.50.4
Status: newassigned

comment:4 Changed 13 years ago by dylan

Milestone: 0.40.5

comment:5 Changed 13 years ago by dylan

Component: WidgetsEditor

comment:6 Changed 12 years ago by bill

Milestone: 0.91.1

Hopefully this will fix itself when FF3 is release which has div with designmode rather than iframes.

comment:7 Changed 12 years ago by bill

Related to #3980?

comment:8 Changed 12 years ago by Adam Peller

Priority: normalhigh

Cougar, is this workaround acceptable? Is it something which can be incorporated into RichText??

comment:9 Changed 12 years ago by Adam Peller

Description: modified (diff)

comment:10 Changed 12 years ago by liucougar

it did not work as expected, last time I tried something similar to the patch

comment:11 Changed 12 years ago by alex

Owner: changed from liucougar to alex
Status: assignednew

comment:12 Changed 12 years ago by alex

Status: newassigned

comment:13 Changed 12 years ago by Adam Peller

Resolution: duplicate
Status: assignedclosed

closed in favor of #5099

Note: See TracTickets for help on using tickets.