Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#6577 closed Bug (fixed)

selection error when editor element is hidden

Reported by: cobaltbluedw 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 6 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 in reply to: ↑ description Changed 6 years ago by cobaltbluedw

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 6 years ago by garry.yao

  • Keywords Firefox added; mozilla load bookmark removed

Changed 6 years ago by garry.yao

comment:3 Changed 6 years ago by garry.yao

Gecko bug reported.

comment:4 Changed 6 years ago by garry.yao

  • Status changed from new to confirmed
  • Summary changed from loading / bookmarking error in mozilla browsers? to selection error when editor element is hidden
  • Version changed from 3.4 to 3.0

comment:5 Changed 5 years ago by wwalc

  • Milestone set to 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 5 years ago by garry.yao

  • Resolution set to fixed
  • Status changed from confirmed to closed

Fixed with [6313].

comment:7 Changed 5 years ago by fredck

Any chance to have a TC file for this one?

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