Opened 15 years ago
Closed 11 years ago
#5309 closed New Feature (fixed)
Context sensitive insertHtml
Reported by: | Garry Yao | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Pasting | Version: | |
Keywords: | Cc: |
Description (last modified by )
We've seen various paste problems caused by our current implementation of CKEDITOR.editor::insertHtml, now rely on browsers' native API, which is buggy and inconsistent.
While we do have other options here: The idea is to implement an DTD aware, context sensitive insertion based on CKEDITOR.htmlParser' and 'CKEDITOR.editor::insertElement', this should be able to extinguish all weird bugs around.
Related tickets are:
- #5696
- IE : Cursor moves to the start of paragraph in the Pasted Text
- #5367
- Implement editor.insertText and use it in the special chars dialog
- #5536
- Problems with pasting (executing insertHtml) and formatted text
- #5170
- Problems with pasting (executing insertHtml) and formatted text
- #5033
- Invalid behavior when inserting nested divs with insertHtml()
- #4898
- Paste: After pasting a table from word it is not possible to navigate outside the table
- #4746
- insertHtml left trim text
- #3105
- insertHtml and insertElement should agree on the result
- #2781
- FckEditor InsertHtml inserts extra <p> tags
- #2749
- InsertHtml() is inconsistent between IE 7 and Firefox 2
- #2526
- InsertHTML Problem
- #503
- Unordered list paste: doesn't work correctly in IE
Attachments (6)
Change History (25)
comment:1 Changed 15 years ago by
Component: | General → Core : Pasting |
---|---|
Description: | modified (diff) |
comment:2 Changed 15 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 15 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 15 years ago by
By checking the insertHtml API in latest HTML5 draft, it also doesn't require a context sensitive insertion:
4. Invoke the HTML fragment parsing algorithm with an arbitrary orphan 'body' element owned by the same Document as the context element and with the value argument as input.
comment:5 Changed 15 years ago by
Milestone: | CKEditor 3.3 → CKEditor 3.4 |
---|
We're over burdened now so this feature will be deferred to next milestone.
Changed 15 years ago by
Attachment: | 5309.patch added |
---|
comment:6 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Keywords: | Confirmed Review? added; Umbrella removed |
Owner: | set to Garry Yao |
Status: | new → assigned |
Type: | Task → New Feature |
Ported a simplified version of Firefox's nsHTMLEditor::InsertHTMLWithContext while it supposed to be browser neutral paste implementation.
comment:7 Changed 15 years ago by
Description: | modified (diff) |
---|
Changed 15 years ago by
Attachment: | 5309_2.patch added |
---|
comment:9 Changed 15 years ago by
Might be a duplicate of one of the tickets, but I'm adding it just to have one more test case: #5873
comment:10 Changed 15 years ago by
Milestone: | CKEditor 3.4 → CKEditor 3.5 |
---|
comment:11 Changed 14 years ago by
Milestone: | CKEditor 3.4.1 → CKEditor 3.5 |
---|
Changed 14 years ago by
Attachment: | 5309_4.patch added |
---|
Changed 14 years ago by
Attachment: | 5309_5.patch added |
---|
comment:13 Changed 14 years ago by
New patch with some updates:
- Instead of using "range::extractContent" which is currently buggy when dealing with list and table selection, we now play a browser trick (insertHtml called with an empty content) to achieve the same result;
- Introduce a HTML parser param (clipboard) to handle the case when parsing context of the fragment is unknown, where we should not touch the white-spaces children of the fragment.
comment:14 Changed 14 years ago by
It looks like a huge task to make a reviewing here, so let me also propose some orders here:
- First we check there's no exception thrown in any case when pasting, this must be guaranteed;
- Then we should check paste in any case should not result in malformed structure (DTD valid);
- Finally it come to a case by case test with different combination of clipboard content and selection type to check the rationality of the result, in case it's amphibolous, we should allow it to be handled out of this ticket.
Changed 14 years ago by
Attachment: | 5309_6.patch added |
---|
comment:16 Changed 14 years ago by
Keywords: | Confirmed removed |
---|---|
Status: | review → review_failed |
Please align the patch with the latest updates (data-cke attributes).
comment:17 Changed 14 years ago by
Milestone: | CKEditor 3.5 → CKEditor 3.6 |
---|
This one, other than introducing a good amount of code into core (justifiable), touches import part of it. We need a lot of attention on it and we'll not be able to safely land this on the SVN for the 3.5.
comment:18 Changed 14 years ago by
Milestone: | CKEditor 3.6 |
---|
Minor adjustments.