Opened 13 years ago

Last modified 11 years ago

#8482 confirmed Bug

DispHTMLUnknownElement with invalid code

Reported by: matteo.ugolini Owned by:
Priority: Normal Milestone:
Component: General Version: 3.1
Keywords: IE Cc:

Description

By selecting a dom range who contains invalid Html tags, IE causes an error in the error function at the line 201 of the element.js:

this.$.appendChild( node.$ );

In the case value contains an invalid tag, fe.: <foo>some content</foo>, the "this.$" is an instance of DispHTMLUnknownElement who doesn't implements the appendChild function.

the error is caused by the range.select(true), this.createBookmark(); line 1636 plugins/selection/plugin.js, clone.insertNode( startNode ); line 528 /core/dom/range.js

We are currently experiencing this issue with IE 8 and 9, we haven't tried with prior version of the software.

Attachments (2)

customtag.zip (588 bytes) - added by Jakub Ś 12 years ago.
customtag_v4.zip (592 bytes) - added by Jakub Ś 11 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 13 years ago by Jakub Ś

Status: newpending

Could I ask you to provide a JavaScript code you are using reproduce the issue?

Or perhaps better - a reproducible reduced test case?

comment:2 Changed 13 years ago by Jakub Ś

@matteo.ugolini any chance for a reduced test case showing the problem?

comment:3 Changed 12 years ago by OlaA

[edit: Never mind, I forgot to include the custom namespace, and found a DispHTMLUnknownElement when debugging, thinking this bug was related]

I'm experiencing the same problem, with a plugin that styles selected text with a custom tag. The custom tag contains a ':' character, the problem does not occur if the ':' is removed.

This is on CKEditor 3.6 (revision 6902).

Here's a simplified version of the plugin code I'm using:

CKEDITOR.plugins.add('customtag', 
{
  requires: ['styles', 'button'],
  init: function(editor)
  {
    var style = new CKEDITOR.style({element: 'custom:tag'});
    
    editor.attachStyleStateChange(style, function(state)
      {
        !editor.readOnly && editor.getCommand('switchCustomTag').setState(state);
      });
    
    editor.addCommand('switchCustomTag', new CKEDITOR.styleCommand(style));
    
    editor.ui.addButton('switchCustomTagButton', 
      {
        label: 'Switch custom tag', 
        command: 'switchCustomTag'
      });
  },
});
Last edited 12 years ago by OlaA (previous) (diff)

comment:4 Changed 12 years ago by Jakub Ś

Keywords: IE added
Status: pendingconfirmed
Version: 3.6.3 (SVN - trunk)3.1

Issue Has been reproducible in IE6-8, other browsers work fine. I have managed to reproduce it from CKEditor 3.1

To test it copy attached folder into /_source/samples/ folder and add the below code to CKEditor configuration

extraPlugins : 'customtag', 
toolbar : [['switchCustomTagButton']]

JS error that occurs:
Message: Unexpected call to method or property access
Line: 201
URI: /3.6.2/ckeditor/_source/core/dom/element.js

Changed 12 years ago by Jakub Ś

Attachment: customtag.zip added

Changed 11 years ago by Jakub Ś

Attachment: customtag_v4.zip added

comment:5 Changed 11 years ago by Jakub Ś

It seems this is still an issue in latest CKEditor 4.2 in IE8.

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