Opened 5 years ago

Last modified 3 years ago

#12480 review Bug

Error in console after removing formatting and disabling selection as a list item.

Reported by: Artur Delura Owned by: kkrzton
Priority: Nice to have (we want to work on it) Milestone:
Component: General Version: 3.0
Keywords: Cc:

Description (last modified by kkrzton)

Browsers: Chrome, FF and IE9+

  1. Open editor with following content and selection:
    <ol>
    	<li>hello</li>
    	<li>moto</li>
    	<li><strong>[:D]</strong></li>
    </ol>
    
  2. Click "Remove format" button.
  3. Press "Ordered List" or "Unordered List" button.

Actual result:

There is an error in console: TypeError: node is null range.js:1724

this.setStart( node.getParent(), node.getIndex() );

Change History (15)

comment:1 Changed 5 years ago by Artur Delura

Description: modified (diff)

comment:2 Changed 5 years ago by Artur Delura

Version: 4.0

comment:3 Changed 5 years ago by Jakub Ś

Description: modified (diff)
Status: newconfirmed
Version: 4.03.0

I was able to reproduce this problem from CKEditor 3.0 in every browser except IE8.

Last edited 5 years ago by Jakub Ś (previous) (diff)

comment:4 Changed 4 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.7

comment:5 Changed 4 years ago by kkrzton

Owner: set to kkrzton
Status: confirmedassigned

comment:6 Changed 4 years ago by kkrzton

For html like this (with :D selected):

<ol>
    <li>hello</li>
    <li>moto</li>
    <li>:D</li>
</ol>

During element manipulation (e.g. list/unlist) selection is bookmarked as follows:

<ol>
    <li>hello</li>
    <li>moto</li>
    <li><span id="cke_bm_204S" style="display:none">&nbsp;</span>:D<span id="cke_bm_204E" style="display:none">&nbsp;</span></li>
</ol>

so the bookmarks are inside li element.

When applying remove format to the above selection, bookmarks are moved outside li element:

<ol>
    <li>hello</li>
    <li>moto</li>
    <span data-cke-bookmark="1" style="display: none;">&nbsp;</span>
    <li>:D</li>
</ol>
<span data-cke-bookmark="1" style="display: none;">&nbsp;</span>

and so it breaks further processing.

comment:7 Changed 4 years ago by kkrzton

Description: modified (diff)

This issue does not occur in IE8.

comment:8 Changed 4 years ago by kkrzton

Status: assignedreview

Changes in t/12480.

This fix adds range clone on which removing format is processed (nothing changes in the process itself). The range clone is enlarged during the process which is the cause of change in placement of selection bookmarks (as mentioned in earlier comment). The original range is shrinked so its start and end containers points to selected text (and not the containing nodes which may be removed by removeformat).

Selection is restored based on original range which assures it contains as little additional elements as possible. There is one exception for containers with conteneteditable elements which should use enlarged range for selection restoring.

comment:9 Changed 4 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.7CKEditor 4.5.8

comment:10 Changed 4 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.8CKEditor 4.5.9

comment:11 Changed 4 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.9CKEditor 4.5.10

comment:12 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.10CKEditor 4.5.11

Moving tickets to the next milestone.

comment:13 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.11CKEditor 4.6.1

comment:14 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.6.1CKEditor 4.6.2

Moving to 4.6.2 minor release, as 4.6.1 is mostly about polishing 4.6.0.

comment:15 Changed 3 years ago by Marek Lewandowski

Milestone: CKEditor 4.6.2
Priority: NormalNice to have (we want to work on it)

Moving to the nice to have list.

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