Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#4054 closed defect (fixed)

JS exception in Editor code on dojo.query() call: body not found

Reported by: bill Owned by: liucougar
Priority: high Milestone: 0.9
Component: Query Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

Problem when loading Editor with a stylesheet specified over http://, (not file://). Happens in themeTester.html. Breaks on line 647:

 dojo.query("body", this.document.documentElement)[0].innerHTML = html;

Problem is that this.document.documentElement.innerHTML at this point is

<head>
<style>body,html { background:transparent; padding: 0; margin: 0;}body{ top:0px; left:0px; right:0px;position: fixed; font:400 13px "Myriad Pro",Myriad,Arial,Helvetica,clean,sans-serif; min-height:1em; line-height:1.0}p{ margin: 1em 0 !important; }body > *:first-child{ padding-top:0 !important;margin-top:0px !important;}body > *:last-child { padding-bottom:0 !important; margin-bottom:0px !important;}li > ul:-moz-first-node, li > ol:-moz-first-node{ padding-top: 1.2em; } li{ min-height:1.2em; }</style>
<link rel="stylesheet" type="text/css" href="http://mac.local/0.9/dojo/resources/dojo.css">
</head>

The <body></body> tags are getting cutoff even though we set them. There's a line of code:

setTimeout(ifrFunc, 250);

If I change 250 to 5000 it works.

But I'm wondering why we have to set innerHTML at all. Why not just pass the body text to _getIframeDocTxt()? Is it so we can reset the editor text from a setValue() call?

Change History (6)

comment:1 Changed 12 years ago by liucougar

loaded fine in my IE 6

what you did to see the breaks?

comment:2 Changed 12 years ago by bill

Description: modified (diff)
Summary: JS exception in Editor code on themeTester.html load (FF)JS exception in Editor code on dojo.query() call: body not found

The problem is only happening for me on FF/Mac but it's a race condition (on top of a firefox bug). I updated the bug description above to be more accurate.

comment:3 Changed 12 years ago by bill

Description: modified (diff)

comment:4 Changed 12 years ago by liucougar

(In [10091]) refs #4054: bill, please try this and see whether it can fix this bug for you in mac fixes #2276: wide content in editor is impossible to edit

comment:5 Changed 12 years ago by bill

Resolution: fixed
Status: newclosed

Great, that fixed it :-)

comment:6 Changed 10 years ago by bill

Component: EditorQuery
Note: See TracTickets for help on using tickets.