﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1271	Opera: Small space is appended when applying styles to collapsed selections	Frederico Caldeira Knabben	Hallvord R. M. Steen (Opera Software)	"This bug is a follow up to #253. This specific feature has been introduced for that ticket, but Opera presents a strange behavior.

== Steps to Reproduce ==

 1. Load sample01.html;
 2. Place the cursor in the middle of the word ""some"". For example, after the ""o"";
 3. Press CTRL+B several times. The toolbar will behave correctly to the command, but note that a small space is added for each time it get pressed.

Analyzing the DOM after CTRL+B, all we have is ""so<b></b>me"", with the selection inside <b>. That was our intention, but the small space get rendered for the empty <b>.

The code which applies the style can be found in the ""_ApplyInlineStyle"" function in fckstyle.js. It can be condensed to the following code, which is the only way we have found to make it work with Opera:

{{{
// Here the <b> tag is build.
var collapsedElement = this.BuildElement( range.Window.document ) ;
collapsedElement.innerHTML = '&nbsp;' ;
range.InsertNode( collapsedElement ) ;
range.MoveToNodeContents( collapsedElement ) ;
range.Select() ;
FCKSelection.Delete() ;
}}}

To note that ""range"" is FCKDomRange, not a standard DOM Range object."	Bug	closed	Must have (possibly next milestone)	Opera Compatibility	Core : Styles	SVN (FCKeditor) - Retired	worksforme		Hallvord R. M. Steen (Opera Software)
