Ticket #1301 (closed defect: duplicate)

Opened 4 years ago

Last modified 3 years ago

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
Severity: major Keywords: Editor2 designMode firefox
Cc:

Description (last modified by peller) (diff)

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

Changed 4 years ago by liucougar

  • owner changed from bill to liucougar

Changed 4 years ago by dylan

  • milestone set to 0.5

Changed 4 years ago by liucougar

  • status changed from new to assigned
  • milestone changed from 0.5 to 0.4

Changed 4 years ago by dylan

  • milestone changed from 0.4 to 0.5

Changed 4 years ago by dylan

  • component changed from Widgets to Editor

Changed 3 years ago by bill

  • milestone changed from 0.9 to 1.1

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

Changed 3 years ago by bill

Related to #3980?

Changed 3 years ago by peller

  • priority changed from normal to high

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

Changed 3 years ago by peller

  • description modified (diff)

Changed 3 years ago by liucougar

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

Changed 3 years ago by alex

  • owner changed from liucougar to alex
  • status changed from assigned to new

Changed 3 years ago by alex

  • status changed from new to assigned

Changed 3 years ago by peller

  • status changed from assigned to closed
  • resolution set to duplicate

closed in favor of #5099

Note: See TracTickets for help on using tickets.