Opened 16 years ago
Closed 16 years ago
#3436 closed Bug (fixed)
Inline styles are being applied to outside of selected area in IE.
Reported by: | Martin Kou | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | Core : Styles | Version: | SVN (CKEditor) - OLD |
Keywords: | IE8 Confirmed Review+ | Cc: |
Description
To reproduce:
- Open replacebyclass.html in IE.
- Double click "You" in the editing area.
- Click the Bold button.
- "You are using " is bolded.
The bug can be reproduced across IE6, 7 and 8.
Attachments (2)
Change History (12)
comment:1 Changed 16 years ago by
Keywords: | WorksForMe added |
---|
comment:2 Changed 16 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | new → assigned |
comment:3 Changed 16 years ago by
Keywords: | WorksForMe removed |
---|
I can still reproduce it in IE8, in both compatibility mode and standards mode.
Screencast here: http://screencast.com/t/pujottPWZ
comment:4 Changed 16 years ago by
Keywords: | IE8 added; IE removed |
---|
After some rechecking, the problem is specific to IE8. And the culprit seems to be the selection plugin. Still investigating for the fix.
Changed 16 years ago by
Attachment: | 3436_tc.patch added |
---|
comment:5 Changed 16 years ago by
Added unit test case, it passes in IE6 and IE7, but fails in IE8. The bug is definitely in the selection plugin.
comment:6 Changed 16 years ago by
Keywords: | Confirmed added |
---|
A while ago when I tested on IE8 FC, it's shown that the native selection range reporting is incorrect, not sure but probably browser bug somehow.
comment:7 Changed 16 years ago by
Ok, this is a really hideous browser DOM bug. The problem (as in the test case) happens like this:
- A DOM range object is obtained in L31 of the test case, and the range's positions are actually correct.
- range.select() is called.
- range.select() inserts bookmark nodes into the document. The bookmark at the end point is inserted first. This end point is right after the string "This".
- range.createBookmark() is called.
- range.createBookmark() calls trim() to split "This" from " is some " on a cloned range object whose position is collapsed right after "This".
- So cloned.trim() calls textNode.split(4). So the text node "This is some " is split into "This" and " is some ". So far so good.
- So cloned.trim() updates the startParent to the parent P node and startOffset to 1. Which means the collapsed range's position is now theoretically at "This^ is some".
- But no... IE8 thinks the range's position is actually at "This is some^<strong>sample text</strong>" despite we've got the correct startContainer and the correct startOffset! See next point for the reason.
- Apparently IE8 thinks P.childNodes[0] is "This" - that's correct. But P.childNodes[1] is the STRONG tag! Despite the fact that it will report correctly to you that STRONG.previousSibling is " is some " and "This".nextSibling is " is some ".
Alfonso has already reported this bug to Microsoft here: http://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=426520.
Changed 16 years ago by
Attachment: | 3436.patch added |
---|
comment:8 Changed 16 years ago by
Keywords: | Review? added |
---|
comment:9 Changed 16 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:10 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [3470].
Click here for more info about our SVN system.
WFM, can you re-verify it?