Opened 16 years ago

Closed 16 years ago

#3146 closed Bug (fixed)

Insert link incorrect within table cell

Reported by: Garry Yao Owned by: Martin Kou
Priority: Must have (possibly next milestone) Milestone: CKEditor 3.0
Component: Core : Styles Version: SVN (FCKeditor) - Retired
Keywords: Confirmed Review+ Cc:

Description (last modified by Martin Kou)

Reproducing Procedures

  1. Open the replace by code example page;
  2. Make document content and selection as following by double click on cell:
    <table>
    	<tbody>
    		<tr>
    			<td>^
    				text^</td>
    		</tr>
    	</tbody>
    </table>
    
    1. Open link dialog to insert a default link.
    • Actual Result : The link is not inserted at all.

Additional information: This is actually a style system bug. The same thing happens if you press the bold button or try to apply any inline style with the HTML and selection above.

Attachments (1)

3146.patch (1.2 KB) - added by Martin Kou 16 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 16 years ago by Garry Yao

Same thing happens for list items.

Reproducing Procedures

  1. Open the replace by code example page;
  2. Make document content and selection as following by double click on secondary list item:
    <ol>
    	<li>
    		level1</li>
    	<li>
    		^leve1^</li>
    </ol>
    
    1. Open link dialog to insert a default link.
    • Actual Result : The link is not inserted at all.

comment:2 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added
Priority: NormalHigh

WFM with the table case, but it is buggy with the list example.

comment:3 Changed 16 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

Changed 16 years ago by Martin Kou

Attachment: 3146.patch added

comment:4 Changed 16 years ago by Martin Kou

Component: GeneralCore : Styles
Description: modified (diff)
Keywords: Review? added

The problem actually lies in the style system, in the applyInlineStyle() function. You can see the same bug with the same HTML and the same selection by pressing the bold button - nothing happens.

What happened in the applyInlineStyle() function is that the calculation of firstNode and lastNode in line 280, 281 is wrong. The lastNode calculated from there actually comes before the firstNode (you can verify by printing out their getAddress() output). We already have a more well tested way in CKEDITOR.dom.range::getBoundaryNodes() to do the same thing, so that function should be used instead.

comment:5 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

Please remove the lastParent.type == CKEDITOR.NODE_ELEMENT check, as getParent will only return element type objects.

comment:6 Changed 16 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [3274] and [3275].

Click here for more info about our SVN system.

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