Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#11925 closed Bug (wontfix)

Calling getUniqueId on a container fails in IE8

Reported by: jbalsas Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:


Calling getUniqueId method on elements seems to be failing in IE8

Steps to reproduce:

  1. Navigate to in IE8
  2. Open dev tools
  3. Type the following sequence:
    editor = CKEDITOR.instances.editor1
    container = editor.getSelection().getRanges()[0].startContainer

Result: An Object doesn't support this property or method error is thrown.

Expected: No error to be thrown and the element unique id to be returned

Change History (6)

comment:1 Changed 3 years ago by Reinmar

  • Status changed from new to confirmed

Wow... This is very, very odd:

> typeof container.getUniqueId

> container.getUniqueId.toString()
"function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]}"


> container.getUniqueId()
"Object doesn't support this property or method"

Looks like an ugly IE8 bug. That will be an awesome fun debugging this :D.

comment:2 Changed 3 years ago by jbalsas

Glad you like it! :D


> container.getUniqueId.apply(container)
"Object doesn't support this property or method"

> container.getUniqueId.apply(window)
Last edited 3 years ago by jbalsas (previous) (diff)

comment:3 Changed 3 years ago by m.lewandowski

most likely it's due to calling text node, it works with elements, see:

var p = CKEDITOR.instances.editor1.editable().getFirst();

// works

var txt = p.getFirst().getNext();

// Does not work
// throws: "Object doesn't support this property or method"

// note:
// throws exception: "'this.$.data-cke-expando' is null or not an object"

comment:4 Changed 3 years ago by Reinmar

This method is defined in CKEDITOR.dom.domObject, so it should work on all elements. Although, I remember that on some older IEs the expando didn't work, because it couldn't be set on text nodes. Maybe we were confused by the error message which looks like a method does not exist. Maybe IE throws this when setting as Marek said. We'll check this, but if it's right, then it's a "won't fix" of course.

comment:5 Changed 3 years ago by Reinmar

  • Resolution set to wontfix
  • Status changed from confirmed to closed
>>document.createTextNode('foo')['data-cke-expando'] = 1';
  "Object doesn't support this property or method"

Yup. So getUniqueId can't work on text nodes in IE8. Added note about this in docs: git:81dc62302.

comment:6 Changed 3 years ago by jbalsas

Thanks for looking into it...

Sad we can't fix this somehow, since it renders that API basically unusable if you need to support IE8 :(

Glad at least we've got it documented now.

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy