[CKEditor Dev] #9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area causes Javascript Error

6 views
Skip to first unread message

CKEditor

unread,
Dec 6, 2012, 2:53:42 PM12/6/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
------------------------------+-------------------
Reporter: aflorin | Type: Bug
Status: new | Priority: Normal
Component: Core : Read-only | Version: 4.0
Keywords: |
------------------------------+-------------------
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

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780>
CKEditor <http://ckeditor.com/>
The text editor for the Internet

CKEditor

unread,
Dec 6, 2012, 2:56:48 PM12/6/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+-----------------
Reporter: aflorin | Owner:
Type: Bug | Status: new
Priority: Normal | Milestone:

Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+-----------------

Comment (by aflorin):

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

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:1>

CKEditor

unread,
Dec 7, 2012, 7:11:51 AM12/7/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+---------------------
Reporter: aflorin | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:

Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+---------------------
Changes (by j.swiderski):

* status: new => pending


Comment:

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:2>

CKEditor

unread,
Dec 9, 2012, 4:40:08 PM12/9/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+---------------------
Reporter: aflorin | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by aflorin):

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 "-//W3C//DTD HTML 4.01//EN"
"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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:3>

CKEditor

unread,
Dec 9, 2012, 5:26:11 PM12/9/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+---------------------
Reporter: aflorin | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by aflorin):

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:4>

CKEditor

unread,
Dec 12, 2012, 10:32:50 PM12/12/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+---------------------
Reporter: aflorin | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by aflorin):

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

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:5>

CKEditor

unread,
Dec 13, 2012, 5:50:22 AM12/13/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+---------------------
Reporter: aflorin | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by j.swiderski):

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

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:6>

CKEditor

unread,
Dec 31, 2012, 9:48:45 AM12/31/12
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+---------------------
Reporter: aflorin | Owner:
Type: Bug | Status: pending
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by j.swiderski):

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.

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:7>

CKEditor

unread,
Apr 15, 2013, 7:04:29 AM4/15/13
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+-----------------------
Reporter: aflorin | Owner:
Type: Bug | Status: confirmed
Priority: Normal | Milestone:

Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+-----------------------
Changes (by j.swiderski):

* status: pending => confirmed


Old description:

> 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

New description:

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:**[[BR]]
Message: SCRIPT5007: Unable to get value of the property 'ownerDocument':
object is null or undefined. [[BR]]
Line: 370 [[BR]]
URI: /ckeditor/core/selection.js

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

--

Comment:

#10309 was marked as duplicate

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:8>

CKEditor

unread,
Apr 19, 2013, 6:48:10 AM4/19/13
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+-----------------------
Reporter: aflorin | Owner:
Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+-----------------------

Comment (by req):

Reproducible in IE10. This is closely linked to selections, you can
reproduce the error in JS console with
{{{
CKEDITOR.document.$.selection.parentElement().ownerDocument
// CKEDITOR.document.$.selection is [object MSSelection]
}}}
You can do this at any point to get the same error, not only when the
editor is disabled. It seems that this code is just only called when the
editor is disabled and a user clicks on the area, so that's why the bug
appears in that situation.

Also for further information; this seems to happen in the mouseup event.

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:9>

CKEditor

unread,
Sep 17, 2013, 4:00:25 PM9/17/13
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+-----------------------
Reporter: aflorin | Owner:
Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+-----------------------

Comment (by maufarinelli):

Do you guys have some fix for this?
I get the same problem.

I load a page with some CKEDITOR's instances, but sometimes I need to set
readOnly in one of the instances.
Then, I get:
{{{
SCRIPT5007: Impossible d’obtenir la propriété « innerHTML » d’une
référence null ou non définie
ckeditor.js, Ligne 17 Caractère 45
}}}

and If I click on it, I get:
{{{
SCRIPT5007: Impossible d’obtenir la propriété « ownerDocument » d’une
référence null ou non définie
ckeditor.js, Ligne 131 Caractère 1519
}}}

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:10>

CKEditor

unread,
May 14, 2015, 5:53:09 AM5/14/15
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+-----------------------
Reporter: aflorin | Owner:
Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+-----------------------

Comment (by zevane):

I've made a workaround for this issue. I post it here, should it help you:

At core/selection.js, line 756

Instead of:

{{{
if ( sel.type != 'None' && range.parentElement().ownerDocument == doc.$ )
}}}

Use this:

{{{
if ( sel.type != 'None' && (range.parentElement() || {}).ownerDocument ==
doc.$ )
}}}

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:11>

CKEditor

unread,
Jan 5, 2017, 7:27:36 AM1/5/17
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
-------------------------------+-----------------------
Reporter: aflorin | Owner:
Type: Bug | Status: confirmed
Priority: Normal | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
-------------------------------+-----------------------

Comment (by paulvrugt):

Any news on this? This bug is now FOUR year old, and the last activity is
20 months ago. The fix seems fairly easy so is it possible to include this
fix in a release?

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:12>

CKEditor

unread,
Jan 17, 2017, 5:59:04 AM1/17/17
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
---------------------------------------------------+-----------------------

Reporter: aflorin | Owner:
Type: Bug | Status: confirmed
Priority: Nice to have (we want to work on it) | Milestone:

Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
---------------------------------------------------+-----------------------
Changes (by m.lewandowski):

* priority: Normal => Nice to have (we want to work on it)


Comment:

Let's check this one, as it's easy to reproduce.

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:13>

CKEditor

unread,
Jan 24, 2017, 10:16:32 AM1/24/17
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
---------------------------------------------------+-----------------------
Reporter: aflorin | Owner:
Type: Bug | Status: confirmed
Priority: Nice to have (we want to work on it) | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
---------------------------------------------------+-----------------------

Comment (by j.swiderski):

It is possible #16820 is related and perhaps both could be solved with the
same fix.

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:14>

CKEditor

unread,
May 17, 2017, 3:36:09 AM5/17/17
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
---------------------------------------------------+----------------------
Reporter: aflorin | Owner: msamsel
Type: Bug | Status: assigned

Priority: Nice to have (we want to work on it) | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
---------------------------------------------------+----------------------
Changes (by msamsel):

* owner: => msamsel
* status: confirmed => assigned


--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:15>

CKEditor

unread,
May 17, 2017, 11:04:51 AM5/17/17
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
---------------------------------------------------+----------------------
Reporter: aflorin | Owner: msamsel
Type: Bug | Status: assigned
Priority: Nice to have (we want to work on it) | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
---------------------------------------------------+----------------------

Comment (by msamsel):

PR:
https://github.com/ckeditor/ckeditor-dev/pull/375

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:16>

CKEditor

unread,
May 29, 2017, 7:54:52 AM5/29/17
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
---------------------------------------------------+---------------------
Reporter: aflorin | Owner: msamsel
Type: Bug | Status: review

Priority: Nice to have (we want to work on it) | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: | Keywords:
---------------------------------------------------+---------------------
Changes (by msamsel):

* status: assigned => review


--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:17>

CKEditor

unread,
Jun 30, 2017, 8:09:08 AM6/30/17
to ckeditor...@googlegroups.com
#9780: Calling setReadOnly(true) in IE 8 and 9 then clicking in the entry area
causes Javascript Error
---------------------------------------------------+---------------------
Reporter: aflorin | Owner: msamsel
Type: Bug | Status: closed

Priority: Nice to have (we want to work on it) | Milestone:
Component: Core : Read-only | Version: 4.0
Resolution: fixed | Keywords:
---------------------------------------------------+---------------------
Changes (by k.krzton):

* status: review => closed
* resolution: => fixed


Comment:

Fixed with [https://github.com/ckeditor/ckeditor-
dev/commit/84f72ad0a831b78c9cdd3a54f9fb45e6196460ef 84f72ad].

--
Ticket URL: <http://dev.ckeditor.com/ticket/9780#comment:18>

Reply all
Reply to author
Forward
0 new messages