Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6577 closed Bug (fixed)

selection error when editor element is hidden

Reported by: David Wipperfurth Owned by:
Priority: Normal Milestone: CKEditor 3.5.1
Component: General Version: 3.0
Keywords: Firefox Cc:

Description

Low Priority

Firebug Error: "q is null" stack trace: "createBookmarks()ckeditor.js (line 119) q(A=Object { _=Object, elementMode=1, more...})ckeditor.js (line 89) isArray()ckeditor.js (line 9) [Break On This Error] A.setStart(B.$,z.startOffset);A.setEnd...u=s&&s[1];if(t)q.attributes.width=t;" (ah the joys of compiled code)

This error occurs after all my code has finished running. I'm guessing from farther down in the onLoad queue?

It has something to do with the offending ckeditor being attached to a completely empty and hidden(as in a parent tag has the 'display:none' property set) textarea. If I put some initial text inside the textarea tag, OR make the textarea visible the error doesn't occur.

My application is complex, and I haven't been able to reproduce the error yet in a simplified form yet. When/if I can, I'll post it.

This error only occurs in FireFox and SeaMonkey. It does not occur in Safari, Opera, IE, or Chrome. All tested on Windows XP with fairly recent versions.

Attachments (1)

6577_firefox_bug.html (1.2 KB) - added by Garry Yao 7 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 in reply to:  description Changed 7 years ago by David Wipperfurth

associated forum thread http://cksource.com/forums/viewtopic.php?f=6&t=20572.

uncompressed error: Firebug Error: selection is null Stack Trace: (?)()plugin.js (line 1331) activateEditing(editor=Object { _=Object, elementMode=1, more...})plugin.js (line 258) (?)()tools.js (line 455) [Break On This Error] selection.removeAllRanges();

basically "var selection = this.document.getSelection().getNative();" fails and is not handled.

comment:2 Changed 7 years ago by Garry Yao

Keywords: Firefox added; mozilla load bookmark removed

Changed 7 years ago by Garry Yao

Attachment: 6577_firefox_bug.html added

comment:3 Changed 7 years ago by Garry Yao

Gecko bug reported.

comment:4 Changed 7 years ago by Garry Yao

Status: newconfirmed
Summary: loading / bookmarking error in mozilla browsers?selection error when editor element is hidden
Version: 3.43.0

comment:5 Changed 7 years ago by Wiktor Walc

Milestone: CKEditor 3.5.1

#6752 was marked as duplicate.

Note that all we need here is a simple if statement in the selection plugin suggested in #6752 to get rid of a javascript error in Firefox when loading CKEditor:

if (selection) {
   selection.removeAllRanges();
   selection.addRange( nativeRange );
}

comment:6 Changed 7 years ago by Garry Yao

Resolution: fixed
Status: confirmedclosed

Fixed with [6313].

comment:7 Changed 7 years ago by Frederico Caldeira Knabben

Any chance to have a TC file for this one?

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