Opened 16 years ago
Closed 16 years ago
#3228 closed Bug (fixed)
List plugin not right on pseudo block
Reported by: | Garry Yao | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | |
Keywords: | Confirmed | Cc: |
Description
Reproducing Procedures
- Open the replace by class example page;
- Make the following content with selection:
<p> te^xt<br />text</p>
- Click on list command;
- Expected Result:
<ol> <li> text</li> </ol> <p> <br /> text</p>
- Actual Result:
<ol> <li> text<br /> text</li> </ol>
- Expected Result:
Attachments (2)
Change History (14)
comment:1 Changed 16 years ago by
Changed 16 years ago by
Attachment: | 3228.patch added |
---|
comment:2 Changed 16 years ago by
Keywords: | Confirmed Review? added |
---|---|
Owner: | set to Garry Yao |
Status: | new → assigned |
The problem here is list style should also enforce real block.
comment:3 follow-up: 4 Changed 16 years ago by
Keywords: | Review- added; Review? removed |
---|
The real problem is not the list plugin. The real problem is happening at L94 in the domiterator plugin. After the range is told to enlarge to include the future list item contents, it actually enlarged to include the whole paragraph.
comment:4 Changed 16 years ago by
comment:5 Changed 16 years ago by
Owner: | changed from Garry Yao to Martin Kou |
---|---|
Status: | assigned → new |
comment:6 follow-up: 8 Changed 16 years ago by
A simpler test case:
- Put the following to the editing area in replacebyclass.html.
<p> te^xt<br />text</p>
- Execute the following script.
e = CKEDITOR.instances.editor1; s = e.getSelection(); r = s.getRanges()[0]; b = r.createBookmark(); // This is essential to trigger the bug r.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS); r.select();
- The whole paragraph, instead of just the first line, is selected.
comment:7 Changed 16 years ago by
:|...
After fixing CKEDITOR.dom.range::enlarge(), CKEDITOR.dom.range::checkEndOfBlock() is also found to be broken.
Changed 16 years ago by
Attachment: | 3228_2.patch added |
---|
comment:8 follow-up: 10 Changed 16 years ago by
Keywords: | Review? added; Review- removed |
---|---|
Status: | new → assigned |
Ok, the patch fixes the following things:
- CKEDITOR.dom.range::enlarge() bug in 6.
- CKEDITOR.dom.range::checkEndOfBlock bug described as follows:
Input:
<p>abc^<br />def<p>
Process:range.checkEndOfBlock();
Expected Value:false
Actual Value:true
- range.js - The BR forgiving logic in getCheckStartEndBlockEvalFunction() forgives every BR instead of only the first encountered BR as specified.
- range.js - BR forgiving logic should not be executed in IE since tail BRs are visible in IE.
- range.js - Possible "walker is not defined" JavaScript error at line 1131.
- range.js - Possible global namespace pollution at L1132 - L1133.
- range.js - Wrong syntax at L1521.
- walker.js - Logical error at L125 - L126 for breakOnFalse == true.
- Minor coding style fix in domiterator plugin.
The patch also adds 5 test cases for CKEDITOR.dom.range::enlarge( CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) and 5 test cases for CKEDITOR.dom.range::checkEndOfBlock().
comment:9 Changed 16 years ago by
Keywords: | Review? removed |
---|
Since we're introducing changes to the range api at #3304. Please freezing this ticket to make sure there's not any confliction.
comment:10 Changed 16 years ago by
Replying to martinkou:
Ok, the patch fixes the following things:
- CKEDITOR.dom.range::enlarge() bug in 6.
I've had this fix at #3304, adapting to the new range walker API.
- CKEDITOR.dom.range::checkEndOfBlock bug described as follows: Input:
<p>abc^<br />def<p>Process:range.checkEndOfBlock();
Expected Value:false
Actual Value:true
- range.js - The BR forgiving logic in getCheckStartEndBlockEvalFunction() forgives every BR instead of only the first encountered BR as specified.
Nice catch.
- range.js - BR forgiving logic should not be executed in IE since tail BRs are visible in IE.
I can't tell the same from this test.
- range.js - Possible "walker is not defined" JavaScript error at line 1131.
- range.js - Possible global namespace pollution at L1132 - L1133.
5.and 6.are same as 1., the bug will vanish as soon as adapting to the new API.
- range.js - Wrong syntax at L1521.
Actually we're preparing to deprecate the touchedNode function pair.
- walker.js - Logical error at L125 - L126 for breakOnFalse == true.
It's not valid, 'breakOnFalse' will only return 'false' for the failure of evaluator.
- Minor coding style fix in domiterator plugin.
The patch also adds 5 test cases for CKEDITOR.dom.range::enlarge( CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ) and 5 test cases for CKEDITOR.dom.range::checkEndOfBlock().
I agreed with all of your TCs except 'test_checkEndOfBlock11'.
comment:11 Changed 16 years ago by
Ok, so I'll need to wait for #3304 for issues 1, 5 and 6. I've just posted some test cases there.
For point 4, tail BRs are indeed visible in IE under editor mode. They're not visible in your sample because your sample doesn't run in editor mode. If you try the following instead you'll see the tail BRs are indeed visible.
- Open replacebyclass.html in IE6, 7, or 8.
- If you're using IE6 or 7, make sure you have not enabled Show Blocks mode.
- Press Shift-Enter at the end of the sample paragraph, you see that a new line is added.
- Inspect the sample paragraph in IE Developer Toolbar, you see that the new line is due to the tail BR.
Point 8.. I've talked to Fred about this yesterday and he seemed to think otherwise. But from the looks of the walker code (i.e. lastForward() and lastBackward()), it seems you're correct. So it seems to me that checkEndOfBlock() and checkStartOfBlock() should change to lastForward() and lastBackward() after #3304 is committed.
comment:12 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Get fixed at #3304.
A more representable TC would be:
Reproducing Procedures