Opened 11 years ago

Last modified 7 years ago

#9780 closed Bug

Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area causes Javascript Error — at Version 8

Reported by: Alex Florin Owned by:
Priority: Nice to have (we want to work on it) Milestone:
Component: Core : Read-only Version: 4.0
Keywords: Cc:

Description (last modified by Jakub Ś)

Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area of the editor causes the Javascript Error listed below.

I have tried it on the latest version of Chrome, Firefox and Safari and none exhibit the problem. I have NOT tried it in other versions of IE.

Message: Unable to get value of the property 'ownerDocument': object is null or undefined Line: 303 Char: 472 Code: 0 URI: http://wolf/Pathway/ckeditor/ckeditor.js?0111891205

Message: Unable to get value of the property 'ownerDocument': object is null or undefined Line: 303 Char: 472 Code: 0 URI: http://wolf/Pathway/ckeditor/ckeditor.js?0111891205


Simplified TC:

  1. Set editor to readOnly:true
  2. Load editor with empty content area
  3. Click inside editor

JS error:
Message: SCRIPT5007: Unable to get value of the property 'ownerDocument': object is null or undefined.
Line: 370
URI: /ckeditor/core/selection.js

Problem can be reproduced from CKEditor 3.6.3 rev. [7374] in IE8-10.

Change History (9)

comment:1 Changed 11 years ago by Alex Florin

Oops. Sorry about including the link to my local ckeditor.js.

comment:2 Changed 11 years ago by Jakub Ś

Status: newpending

I was not able to reproduce this neither in my local build nor in demo page.

  1. Are you able to reproduce this issue only in your app or perhaps on demo page or clean editor without any customizations?
  2. Another option is that you IE settings are causing this thus it would be nice if you could provide exact steps to reproduce this.

comment:3 Changed 11 years ago by Alex Florin

Hey,

I forgot to mention its running under asp.net. However I took that out of the equation and I'm still seeing it. Right in the ckeditor folder, I created HTMLPage1.htm and HTMLPage1.js.

Heres the HTMLPage1.htm:

<!DOCTYPE html PUBLIC "-W3CDTD HTML 4.01EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<title></title> <script language="JavaScript" src="ckeditor.js" type="text/javascript"></script> <script language="JavaScript" src="HTMLPage1.js" type="text/javascript"></script>

</head>

<body onload="handleOnLoad();">

<textarea id="TextBox1" cols="20" rows="2"></textarea>

</body>

</html>

Here is HTMLPage1.js:

function handleOnLoad() {

CKEDITOR.replace('TextBox1', {

on: {

'instanceReady': function (ev) {

ev.editor.setReadOnly(true);

}

}

});

}

When I click on the htm page, the page loads in IE with ckeditor disabled. If I click in the entry area, I get the error in line c.parentElement().ownerDocument of the following code:

CKEDITOR.on("instanceCreated", function (a) {

... ... ...

if (CKEDITOR.env.version > 7) {

n.on("mousedown", function (a) {

if (a.data.getTarget().is("html")) {

e.on("mouseup", r); n.on("mouseup", r)

}

});

var r = function () {

e.removeListener("mouseup", r); n.removeListener("mouseup", r); var b = CKEDITOR.document.$.selection,

c = b.createRange();

b.type != "None" && c.parentElement().ownerDocument == a.$ && c.select()

}

}

It's possible its some IE setting in my box. I'll try it on another developer's machine when I get into work on monday.

comment:4 Changed 11 years ago by Alex Florin

I just noticed that if I set readOnly:true in the replace call, there is no error. So it only occurs when calling the setReadOnly(true) function AFTER the ckeditor is loaded.

comment:5 Changed 11 years ago by Alex Florin

I have tried it on another developer's machine running IE 10 (beta) on windows 7 and it has the same issue. My PC is running windows 7 IE 9.0.8112.164421 with update version 9.0.11

comment:6 Changed 11 years ago by Jakub Ś

@aflorin, thank you for the information and don't worry I will check this once more. I Just need some time.

Changed 11 years ago by Jakub Ś

Attachment: Desktop.zip added

comment:7 Changed 11 years ago by Jakub Ś

Problem can be reproduced from CKEditor 3.6.3 rev. [7374] in IE8-10.

To reproduce just copy attached files into editor samples folder, load page in browser and click in content area.

Other tickets caused by this revision are #8919 and #9329.

comment:8 Changed 11 years ago by Jakub Ś

Description: modified (diff)
Status: pendingconfirmed

#10309 was marked as duplicate

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy