Opened 16 years ago
Closed 16 years ago
#3363 closed Bug (fixed)
Font and Size controls are not working correctly
Reported by: | Senthil | Owned by: | Martin Kou |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | |
Keywords: | Oracle Confirmed IE Review+ | Cc: | Senthil |
Description
Replication steps:
- Select a paragraph of text from the editor area.
- Use the Size control to make the text larger (select 16 in the control). Notice that size 16 indicated in the control.
- Use the Size control and select size 16 again. The text size becomes smaller again. Notice that no size is indicated in the control.
Same thing is happening with Font control also.
Attachments (2)
Change History (13)
comment:1 Changed 16 years ago by
comment:2 Changed 16 years ago by
Keywords: | Pending added |
---|
The Font/Size combo is designed to be toggle-able, not sure if something else is not working as expected besides the marking problem at #3351.
comment:3 Changed 16 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
The font/size toggle is actually a feature rather than a bug - I made a mistake when explaining it to Senthil yesterday because I didn't see the toggle highlight.
So closing this bug as invalid.
comment:4 Changed 16 years ago by
Keywords: | Confirmed IE added; Pending removed |
---|
Just talked with Senthil today, the combos are still not working correctly even when taking into account the toggle behavior. To reproduce the bug:
- Open replacebyclass.html in IE.
- Select "some sample text".
- Change the font to "Comic Sans MS".
- Change the font to "Courier New"
- Now we end up with both Comic Sans MS and Courier New mixed up in the selected text.
A similar bug also happens with the font size combo.
comment:5 Changed 16 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:6 Changed 16 years ago by
Owner: | set to Martin Kou |
---|---|
Status: | reopened → new |
Changed 16 years ago by
Attachment: | 3363.patch added |
---|
comment:7 follow-up: 8 Changed 16 years ago by
Keywords: | Review? added |
---|
Ok.. took me a whole day to figure this out. It's caused by a rather hideous browser bug in IE.
Turns out the (sibling.$.offsetWidth > 0) check we use in CKEDITOR.dom.range::enlarge() doesn't really filter out the bookmark nodes we're adding to the document. IE is reporting an offsetWidth of 3 even though the bookmark nodes have display: none in their CSS styles. This caused the enlarge() function to ignore the existing <span> style tags when applying font and font sizes.
The solution is to add a check for display: none in the element's computed style.
comment:8 Changed 16 years ago by
Replying to martinkou: This' great to see yet another bookmark ignorance problem be dug out, but I wonder if we can use:
sibling.$.offsetWidth > 0 && !sibling.getAttribute( '_fck_bookmark' )
Instead of
sibling.$.offsetWidth > 0 && sibling.getComputedStyle( 'display' ) != 'none'
I'm thinking of the getComputedStyle slowness when invoking on large amounts.
Changed 16 years ago by
Attachment: | 3363_2.patch added |
---|
comment:9 Changed 16 years ago by
Yes, that's a good idea. It shouldn't happen often that we have display: none elements.
comment:10 Changed 16 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:11 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed with [3408].
Click here for more info about our SVN system.
This is related to #3351.