Opened 9 years ago

Closed 8 years ago

#3051 closed Bug (fixed)

Domiterator incorrect with enforceRealBlock

Reported by: Garry Yao Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.1
Component: General Version: 3.0 Beta 2
Keywords: Confirmed Cc:

Description (last modified by Garry Yao)

When domiterator establish new block for one of the pseudo blocks, others should be left untouched, which is currently not respected.

Procedures

  1. Open the replace by code example page;
  2. Make the following content with selection:
    <div>
    	first
    	<p>paragraph</p>se^cond</div>
    
  3. Click on Increase Indent command.
  • Actual Result : A new paragraph is establish for text node 'first' and is indented also.
    <div>
    	<p style="margin-left: 40px;">
    		first</p>
    	<p>
    		paragraph</p>
    	<p style="margin-left: 40px;">
    		second</p>
    </div>
    
  • Expected Result : The pseudo block contains text 'first' should be left untouched while the 'second' chunk should be indented.
    <div>
    	first
    	<p>
    		paragraph</p>
    	<p style="margin-left: 40px;">
    		second</p>
    </div>
    

Attachments (3)

test-domiterator.patch (4.7 KB) - added by Garry Yao 9 years ago.
Unit Test Case
3051.patch (15.5 KB) - added by Garry Yao 9 years ago.
3051_2.patch (5.1 KB) - added by Garry Yao 9 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 9 years ago by Garry Yao

Description: modified (diff)
Summary: RangeIterator not correct with enforcing real blocksDomiterator incorrect with enforceRealBlock

Changed 9 years ago by Garry Yao

Attachment: test-domiterator.patch added

Unit Test Case

comment:2 Changed 9 years ago by Garry Yao

Description: modified (diff)
Keywords: Confirmed added

comment:3 Changed 9 years ago by Frederico Caldeira Knabben

Priority: NormalHigh

comment:4 Changed 9 years ago by Garry Yao

Owner: set to Garry Yao
Status: newassigned

Changed 9 years ago by Garry Yao

Attachment: 3051.patch added

comment:5 Changed 9 years ago by Garry Yao

Keywords: Review? added

The patch is mainly about fixing on anonymous block iteration problem, while also introduce a fix to collapsed range boundaries. TCs established for those issues are also in the patch.

comment:6 Changed 9 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

This patch is breaking the getNextSourceNode and getPreviousSourceNode function. If startFromSibling is set to true, it must not in any way take one of the node children as the first node. That's why we have that parameter after all. So it's wrong to default it to the first child. If we have nothing after it, it's correct to have the function returning null.

comment:7 Changed 9 years ago by Frederico Caldeira Knabben

Priority: HighNormal

comment:8 Changed 9 years ago by Garry Yao

This one is waiting for #3283.

comment:9 Changed 9 years ago by Garry Yao

As discussed no #3203, the getNextSourceNode/getPreviousNode function should not suffer changes, so other implementation should be found to work around this issue.

Changed 9 years ago by Garry Yao

Attachment: 3051_2.patch added

comment:10 Changed 9 years ago by Garry Yao

Keywords: Review? added; Review- removed

The patch is containing the latest patch from #3313 for easy reviewing.

comment:11 Changed 9 years ago by Garry Yao

The patch updated CKEDITOR.dom.range.enlarge method to reflect the newly introduced walker and fixing the bug on collapsed range; As discovered on #3292, we should not rely on CKEDITOR.dom.range.getBoundaryNodes for collapsed range, the patch instead use temporary bookmark to establish the boundary nodes to simplify codes.

comment:12 Changed 8 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.0CKEditor 3.1

comment:13 Changed 8 years ago by Garry Yao

Keywords: Review? removed

This one will be waiting for #3304.

comment:14 Changed 8 years ago by Alfonso Martínez de Lizarrondo

Version: SVN (FCKeditor)CKEditor 3.0 Beta 2

comment:15 Changed 8 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

Unable to reproduce anymore on trunk.

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