Skip to content
Permalink
Browse files

Merge branch 't/11422b' into major

  • Loading branch information
Piotr Jasiun
Piotr Jasiun committed Feb 13, 2014
2 parents 3e9c691 + e567071 commit a84156614620455eb4ac7fa980cb892cf84257a9
@@ -9,6 +9,7 @@ New Features:
* [#11536](http://dev.ckeditor.com/ticket/11536): Added CKEDITOR.tools.htmlDecode method.
* [#11377](http://dev.ckeditor.com/ticket/11377): Unify internal representation of empty anchors using fake objects.
* [#11225](http://dev.ckeditor.com/ticket/11225): Introduced the [`CKEDITOR.tools.transparentImageData`](http://localhost/cksource/ckeditor-docs/build/#!/api/CKEDITOR.tools-property-transparentImageData) property which contains transparent image data to be used in CSS or as images' source.
* [#11422](http://dev.ckeditor.com/ticket/11422): Removed FF3.x, IE6 and Opera12.x leftovers in code.

## CKEditor 4.3.3

@@ -257,7 +257,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
* @param {Boolean} [force] Append filler regardless of the environment.
*/
appendBogus: function( force ) {
if ( !force && !( CKEDITOR.env.needsBrFiller || CKEDITOR.env.opera ) )
if ( !force && !CKEDITOR.env.needsBrFiller )
return;

var lastChild = this.getLast();
@@ -266,7 +266,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
while ( lastChild && lastChild.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim( lastChild.getText() ) )
lastChild = lastChild.getPrevious();
if ( !lastChild || !lastChild.is || !lastChild.is( 'br' ) ) {
var bogus = CKEDITOR.env.opera ? this.getDocument().createText( '' ) : this.getDocument().createElement( 'br' );
var bogus = this.getDocument().createElement( 'br' );

CKEDITOR.env.gecko && bogus.setAttribute( 'type', '_moz' );

@@ -492,7 +492,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
return this.$.getAttribute( name, 2 );
};

if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) {
if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks ) ) {
return function( name ) {
switch ( name ) {
case 'class':
@@ -885,7 +885,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {

// Webkit and Opera report non-zero offsetHeight despite that
// element is inside an invisible iframe. (#4542)
if ( isVisible && ( CKEDITOR.env.webkit || CKEDITOR.env.opera ) ) {
if ( isVisible && CKEDITOR.env.webkit ) {
elementWindow = this.getWindow();

if ( !elementWindow.equals( CKEDITOR.document.getWindow() ) && ( elementWindowFrame = elementWindow.$.frameElement ) )
@@ -931,7 +931,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
* @method
* @returns {Boolean} True if the element has attributes.
*/
hasAttributes: CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ?
hasAttributes: CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks ) ?
function() {
var attributes = this.$.attributes;

@@ -1117,7 +1117,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
return this;
};

if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) {
if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks ) ) {
return function( name, value ) {
if ( name == 'class' )
this.$.className = value;
@@ -1194,7 +1194,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
this.$.removeAttribute( name );
};

if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) ) {
if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks ) ) {
return function( name ) {
if ( name == 'class' )
name = 'className';
@@ -1319,7 +1319,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
// For IE/Opera which doesn't support for the above CSS style,
// the unselectable="on" attribute only specifies the selection
// process cannot start in the element itself, and it doesn't inherit.
if ( CKEDITOR.env.ie || CKEDITOR.env.opera ) {
if ( CKEDITOR.env.ie ) {
this.setAttribute( 'unselectable', 'on' );

var element,
@@ -344,8 +344,7 @@
// Set up the correct selection.
selection.selectRanges( [ range ] );

// Do not scroll after inserting, because Opera may fail on certain element (e.g. iframe/iframe.html).
afterInsert( this, CKEDITOR.env.opera );
afterInsert( this );
},

/**
@@ -491,16 +490,6 @@

// Update focus states.
this.on( 'blur', function( evt ) {
// Opera might raise undesired blur event on editable, check if it's
// really blurred, otherwise cancel the event. (#9459)
if ( CKEDITOR.env.opera ) {
var active = CKEDITOR.document.getActive();
if ( active.equals( this.isInline() ? this : this.getWindow().getFrame() ) ) {
evt.cancel();
return;
}
}

this.hasFocus = false;
}, null, null, -1 );

@@ -696,7 +685,7 @@
CKEDITOR.env.ie && this.attachListener( this, 'click', blockInputClick );

// Gecko/Webkit need some help when selecting control type elements. (#3448)
if ( !( CKEDITOR.env.ie || CKEDITOR.env.opera ) ) {
if ( !CKEDITOR.env.ie ) {
this.attachListener( this, 'mousedown', function( ev ) {
var control = ev.data.getTarget();
if ( control.is( 'img', 'hr', 'input', 'textarea', 'select' ) ) {
@@ -1784,11 +1773,11 @@
editable.editor.fire( 'saveSnapshot' );
}

function afterInsert( editable, noScroll ) {
function afterInsert( editable ) {
var editor = editable.editor;

// Scroll using selection, not ranges, to affect native pastes.
!noScroll && editor.getSelection().scrollIntoView();
editor.getSelection().scrollIntoView();

// Save snaps after the whole execution completed.
// This's a workaround for make DOM modification's happened after
@@ -443,10 +443,6 @@
*/
editor.title = typeof configTitle == 'string' || configTitle === false ? configTitle : [ editor.lang.editor, editor.name ].join( ', ' );

// We're not able to support RTL in Firefox 2 at this time.
if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 && editor.lang.dir == 'rtl' )
editor.lang.dir = 'ltr';

if ( !editor.config.contentsLangDirection ) {
// Fallback to either the editable element direction or editor UI direction depending on creators.
editor.config.contentsLangDirection = editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? editor.element.getDirection( 1 ) : editor.lang.dir;
@@ -17,7 +17,6 @@ if ( !CKEDITOR.env ) {
*/
CKEDITOR.env = ( function() {
var agent = navigator.userAgent.toLowerCase();
var opera = window.opera;

var env = {
/**
@@ -30,16 +29,6 @@ if ( !CKEDITOR.env ) {
*/
ie: ( agent.indexOf( 'trident/' ) > -1 ),

/**
* Indicates that CKEditor is running in Opera.
*
* if ( CKEDITOR.env.opera )
* alert( 'I\'m running in Opera!' );
*
* @property {Boolean}
*/
opera: ( !!opera && opera.version ),

/**
* Indicates that CKEditor is running in a WebKit-based browser, like Safari.
*
@@ -149,7 +138,7 @@ if ( !CKEDITOR.env ) {
*
* @property {Boolean}
*/
env.gecko = ( navigator.product == 'Gecko' && !env.webkit && !env.opera && !env.ie );
env.gecko = ( navigator.product == 'Gecko' && !env.webkit && !env.ie );

/**
* Indicates that CKEditor is running in Chrome.
@@ -233,10 +222,6 @@ if ( !CKEDITOR.env ) {
}
}

// Opera 9.50+
if ( env.opera )
version = parseFloat( opera.version() );

// Adobe AIR 1.0+
// Checked before Safari because AIR have the WebKit rich text editor
// features from Safari 3.0.4, but the version reported is 420.
@@ -279,8 +264,7 @@ if ( !CKEDITOR.env ) {
env.iOS && version >= 534 ||
!env.mobile && (
( env.ie && version > 6 ) ||
( env.gecko && version >= 10801 ) ||
( env.opera && version >= 9.5 ) ||
( env.gecko && version >= 20000 ) ||
( env.air && version >= 1 ) ||
( env.webkit && version >= 522 ) ||
false
@@ -323,24 +307,13 @@ if ( !CKEDITOR.env ) {
*
* @property {String}
*/
env.cssClass = 'cke_browser_' + ( env.ie ? 'ie' : env.gecko ? 'gecko' : env.opera ? 'opera' : env.webkit ? 'webkit' : 'unknown' );
env.cssClass = 'cke_browser_' + ( env.ie ? 'ie' : env.gecko ? 'gecko' : env.webkit ? 'webkit' : 'unknown' );

if ( env.quirks )
env.cssClass += ' cke_browser_quirks';

if ( env.ie ) {
env.cssClass += ' cke_browser_ie' + ( env.quirks || env.version < 7 ? '6' : env.version );

if ( env.quirks )
env.cssClass += ' cke_browser_iequirks';
}

if ( env.gecko ) {
if ( version < 10900 )
env.cssClass += ' cke_browser_gecko18';
else if ( version <= 11000 )
env.cssClass += ' cke_browser_gecko19';
}
if ( env.ie )
env.cssClass += ' cke_browser_ie' + ( env.quirks ? '6 cke_browser_iequirks' : env.version );

if ( env.air )
env.cssClass += ' cke_browser_air';
@@ -310,10 +310,8 @@

cleanBogus( block );

// [Opera] it's mandatory for the filler to present inside of empty block when in WYSIWYG.
if ( ( ( CKEDITOR.env.opera && !isOutput ) ||
( typeof fillEmptyBlock == 'function' ? fillEmptyBlock( block ) !== false : fillEmptyBlock ) ) &&
isEmptyBlockNeedFiller( block ) )
if ( ( typeof fillEmptyBlock == 'function' ? fillEmptyBlock( block ) !== false : fillEmptyBlock ) &&
isEmptyBlockNeedFiller( block ) )
{
block.add( createFiller( isOutput ) );
}
@@ -812,7 +810,7 @@
}

function protectPreFormatted( html ) {
return CKEDITOR.env.opera ? html : html.replace( /(<pre\b[^>]*>)(\r\n|\n)/g, '$1$2$2' );
return html.replace( /(<pre\b[^>]*>)(\r\n|\n)/g, '$1$2$2' );
}

function protectRealComments( html ) {
@@ -87,7 +87,7 @@ CKEDITOR.keystrokeHandler = function( editor ) {

// Some browsers instead, don't cancel key events in the keydown, but in the
// keypress. So we must do a longer trip in those cases.
if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) )
if ( CKEDITOR.env.gecko && CKEDITOR.env.mac )
domObject.on( 'keypress', onKeyPress, this );
}
};
@@ -558,7 +558,7 @@
// Browsers could loose the selection once the editable lost focus,
// in such case we need to reproduce it by saving a locked selection
// and restoring it upon focus gain.
if ( CKEDITOR.env.ie || CKEDITOR.env.opera || isInline ) {
if ( CKEDITOR.env.ie || isInline ) {
// Save a cloned version of current selection.
function saveSel() {
lastSel = new CKEDITOR.dom.selection( editor.getSelection() );
@@ -722,11 +722,10 @@
editor.selectionChange( 1 );
} );

// #9699: On Webkit&Gecko in inline editor and on Opera in framed editor we have to check selection
// when it was changed by dragging and releasing mouse button outside editable. Dragging (mousedown)
// #9699: On Webkit&Gecko in inline editor we have to check selection when it was changed
// by dragging and releasing mouse button outside editable. Dragging (mousedown)
// has to be initialized in editable, but for mouseup we listen on document element.
// On Opera, listening on document element, helps even if mouse button is released outside iframe.
if ( isInline ? ( CKEDITOR.env.webkit || CKEDITOR.env.gecko ) : CKEDITOR.env.opera ) {
if ( isInline && ( CKEDITOR.env.webkit || CKEDITOR.env.gecko ) ) {
var mouseDown;
editable.attachListener( editable, 'mousedown', function() {
mouseDown = 1;
@@ -1889,14 +1888,6 @@
if ( !sel )
return;

// Opera: The above hack work around a *visually wrong* text selection that
// happens in certain situation. (#6874, #9447)
if ( CKEDITOR.env.opera ) {
var nativeRng = this.document.$.createRange();
nativeRng.selectNodeContents( this.root.$ );
sel.addRange( nativeRng );
}

this.removeAllRanges();

for ( var i = 0; i < ranges.length; i++ ) {
@@ -1932,23 +1923,6 @@
var nativeRange = this.document.$.createRange();
var startContainer = range.startContainer;

// In Opera, we have some cases when a collapsed text selection cursor will be moved out of the
// anchor node:
// 1. Inside of any empty inline. (#4657)
// 2. In adjacent to any inline element.
if ( CKEDITOR.env.opera && range.collapsed && startContainer.type == CKEDITOR.NODE_ELEMENT ) {

var leftSib = startContainer.getChild( range.startOffset - 1 ),
rightSib = startContainer.getChild( range.startOffset );

if ( !leftSib && !rightSib && startContainer.is( CKEDITOR.dtd.$removeEmpty ) ||
leftSib && leftSib.type == CKEDITOR.NODE_ELEMENT ||
rightSib && rightSib.type == CKEDITOR.NODE_ELEMENT ) {
range.insertNode( this.document.createText( '' ) );
range.collapse( 1 );
}
}

if ( range.collapsed && CKEDITOR.env.webkit && rangeRequiresFix( range ) ) {
// Append a zero-width space so WebKit will not try to
// move the selection by itself (#1272).
@@ -13,7 +13,6 @@
cssVendorPrefix =
CKEDITOR.env.gecko ? '-moz-' :
CKEDITOR.env.webkit ? '-webkit-' :
CKEDITOR.env.opera ? '-o-' :
CKEDITOR.env.ie ? '-ms-' :
'';

@@ -177,9 +177,8 @@ CKEDITOR.dialog.add( 'a11yHelp', function( editor ) {
'overflow-y:auto;' +
'overflow-x:hidden;' +
'}' +
// Some adjustments are to be done for IE6 and Quirks to work "properly" (#5757)
// Some adjustments are to be done for Quirks to work "properly" (#5757)
'.cke_browser_quirks .cke_accessibility_legend,' +
'.cke_browser_ie6 .cke_accessibility_legend' +
'{' +
'height:390px' +
'}' +

0 comments on commit a841566

Please sign in to comment.
You can’t perform that action at this time.