Skip to content

Commit

Permalink
Merge branch 'master' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed May 19, 2015
2 parents decf792 + 7157492 commit ca891bb
Show file tree
Hide file tree
Showing 16 changed files with 163 additions and 45 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Expand Up @@ -102,7 +102,11 @@ Fixed issues:

Fixed Issues:

* [#13232](http://dev.ckeditor.com/ticket/13232): [Safari] Fixed: Method [`element.appendText()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-appendText) work properly for empty elements.
* [#13233](http://dev.ckeditor.com/ticket/13233): Fixed: HTMLDataProcessor can process `foo:href` attributes.
* [#12899](http://dev.ckeditor.com/ticket/12899): Fixed: Corrected wrong tag ending for horizontal box definition in the [Dialog User Interface](http://ckeditor.com/addon/dialogui) plugin. Thanks to [mizafish](https://github.com/mizafish)!
* [#13254](http://dev.ckeditor.com/ticket/13254): Fixed: Cannot outdent block after indent when using [Divarea](http://ckeditor.com/addon/divarea) plugin. Thanks to [Jonathan Cottrill](https://github.com/jcttrll)!
* [#13268](http://dev.ckeditor.com/ticket/13268): Fixed: Documentation for `CKEDITOR.dom.text` is incorrect. Thanks to [Ben Kiefer](https://github.com/benkiefer)!
* [#12796](http://dev.ckeditor.com/ticket/12796): Fixed: The [Indent List](http://ckeditor.com/addon/indentlist) plugin unwraps parent `<li>` elements.
* [#12885](http://dev.ckeditor.com/ticket/12885): Added missing [`editor.getData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData) parameter documentation.
* [#11982](http://dev.ckeditor.com/ticket/11982): Bullet added in wrong position after the *Enter* key is pressed in a nested list.
Expand All @@ -112,11 +116,14 @@ Fixed Issues:
* [#13031](http://dev.ckeditor.com/ticket/13031): [Firefox] Fixed: No more line breaks in source view since Firefox 36.
* [#13131](http://dev.ckeditor.com/ticket/13131): Fixed: The [Code Snippet](http://ckeditor.com/addon/codesnippet) plugin cannot be used without the [IFrame Editing Area](http://ckeditor.com/addon/wysiwygarea) plugin.
* [#9086](http://dev.ckeditor.com/ticket/9086): Fixed: Invalid ARIA property used on paste iframe.
* [#13164](http://dev.ckeditor.com/ticket/13164): Fixed: Error when inserting a hidden field.

Other Changes:

* [#12844](http://dev.ckeditor.com/ticket/12844) and [#13103](http://dev.ckeditor.com/ticket/13103): Upgraded the [testing environment](http://docs.ckeditor.com/#!/guide/dev_tests) to [Bender.js](https://github.com/benderjs/benderjs) `0.2.3`.
* [#12930](http://dev.ckeditor.com/ticket/12930): Because of licenses, removed `truncated-mathjax/` from the `tests/` directory. Now `bender.config.mathJaxLibPath` must be configured manually in order to run MathJax plugin's tests.
* [#13266](http://dev.ckeditor.com/ticket/13266): Added more shades of gray.


## CKEditor 4.4.7

Expand Down
5 changes: 3 additions & 2 deletions core/dom/element.js
Expand Up @@ -267,10 +267,11 @@ CKEDITOR.dom.element.clearMarkers = function( database, element, removeFromDatab
* // Result: '<p>This is some text</p>'
*
* @param {String} text The text to be appended.
* @returns {CKEDITOR.dom.node} The appended node.
*/
appendText: function( text ) {
if ( this.$.text != null )
// On IE8 it is impossible to append node to script tag, so we use its text.
// On the contrary, on Safari the text property is unpredictable in links. (#13232)
if ( this.$.text != null && CKEDITOR.env.ie && CKEDITOR.env.version < 9 )
this.$.text += text;
else
this.append( new CKEDITOR.dom.text( text ) );
Expand Down
4 changes: 2 additions & 2 deletions core/dom/text.js
Expand Up @@ -12,9 +12,9 @@
* Represents a DOM text node.
*
* var nativeNode = document.createTextNode( 'Example' );
* var text = CKEDITOR.dom.text( nativeNode );
* var text = new CKEDITOR.dom.text( nativeNode );
*
* var text = CKEDITOR.dom.text( 'Example' );
* var text = new CKEDITOR.dom.text( 'Example' );
*
* @class
* @extends CKEDITOR.dom.node
Expand Down
2 changes: 1 addition & 1 deletion core/htmldataprocessor.js
Expand Up @@ -772,7 +772,7 @@
// 'data-x' => '&lt;a href=&quot;X&quot;'
//
// which, can be easily filtered out (#11508).
protectAttributeRegex = /([\w-]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
protectAttributeRegex = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
protectAttributeNameRegex = /^(href|src|name)$/i;

// Note: we use lazy star '*?' to prevent eating everything up to the last occurrence of </style> or </textarea>.
Expand Down
12 changes: 5 additions & 7 deletions plugins/colordialog/dialogs/colordialog.js
Expand Up @@ -236,14 +236,12 @@ CKEDITOR.dialog.add( 'colordialog', function( editor ) {
oRow.setAttribute( 'role', 'row' );

// Create the gray scale colors cells.
for ( var n = 0; n < 6; n++ ) {
appendColorCell( oRow.$, '#' + aColors[ n ] + aColors[ n ] + aColors[ n ] );
}

// Fill the row with black cells.
for ( var i = 0; i < 12; i++ ) {
appendColorCell( oRow.$, '#000000' );
appendColorCell( oRow.$, '#000000' );
for ( var n = 0; n < 16; n++ ) {
var c = n.toString( 16 );
appendColorCell( oRow.$, '#' + c + c + c + c + c + c );
}
appendColorCell( oRow.$, '#ffffff' );
}

var numbering = function( id ) {
Expand Down
5 changes: 3 additions & 2 deletions plugins/forms/dialogs/hiddenfield.js
Expand Up @@ -26,8 +26,9 @@ CKEDITOR.dialog.add( 'hiddenfield', function( editor ) {
onOk: function() {
var name = this.getValueOf( 'info', '_cke_saved_name' ),
editor = this.getParentEditor(),
elementHtml = ( CKEDITOR.document.$.documentMode < 8 ? '<input name="' + CKEDITOR.tools.htmlEncode( name ) + '">' : 'input' ),
element = CKEDITOR.env.ie && editor.document.createElement( elementHtml );
element = CKEDITOR.env.ie && CKEDITOR.document.$.documentMode < 8 ?
editor.document.createElement( '<input name="' + CKEDITOR.tools.htmlEncode( name ) + '">' ) :
editor.document.createElement( 'input' );

element.setAttribute( 'type', 'hidden' );
this.commitContent( element );
Expand Down
4 changes: 3 additions & 1 deletion plugins/indentblock/plugin.js
Expand Up @@ -53,7 +53,9 @@
// Switch context from somewhere inside list item to list item,
// if not found just assign self (doing nothing).
if ( !firstBlock.is( $listItem ) ) {
firstBlock = firstBlock.getAscendant( $listItem ) || firstBlock;
var ascendant = firstBlock.getAscendant( $listItem );

firstBlock = ( ascendant && path.contains( ascendant ) ) || firstBlock;
}

// Switch context from list item to list
Expand Down
2 changes: 1 addition & 1 deletion tests/_benderjs/ckeditor/static/tools.js
Expand Up @@ -271,7 +271,7 @@

if ( fixStyles ) {
html = html.replace( / style="([^"]+)"/g, function( match, style ) {
style = CKEDITOR.tools.writeCssText( CKEDITOR.tools.parseCssText( style, true ) );
style = CKEDITOR.tools.writeCssText( CKEDITOR.tools.parseCssText( style, true ), true );
// Encode e.g. "" in urls().
style = CKEDITOR.tools.htmlEncodeAttr( style );

Expand Down
7 changes: 7 additions & 0 deletions tests/core/dom/element/element.js
Expand Up @@ -133,6 +133,13 @@ bender.test( appendDomObjectTests(
assert.areEqual( 'Test appendText', element.$.text );
},

// #13232
'test appendText to link': function() {
var element = newElement( 'a' );
element.appendText( '@' );
assert.areEqual( '@', element.getText() );
},

test_setHtml: function() {
var element = newElement( document.getElementById( 'append' ) );
element.setHtml( '<b>Test</b>' );
Expand Down
19 changes: 19 additions & 0 deletions tests/core/dom/range/misc.js
Expand Up @@ -255,10 +255,27 @@
assert.areEqual( '<div>te[xt<div>]x</div></div>', bender.tools.getHtmlWithRanges( playground, new CKEDITOR.dom.rangeList( [ range ] ) ) );
},

'test clone': function() {
var range = new CKEDITOR.dom.range( doc );

range.selectNodeContents( doc.getBody() );

var range2 = range.clone();

assert.areSame( range.root, range2.root, 'root' );
assert.areSame( range.startContainer, range2.startContainer, 'startContainer' );
assert.areSame( range.endContainer, range2.endContainer, 'endContainer' );
assert.areSame( range.startOffset, range2.startOffset, 'startOffset' );
assert.areSame( range.endOffset, range2.endOffset, 'endOffset' );
assert.areSame( range.collapsed, range2.collapsed, 'collapsed' );
},

'test _setStartContainer': function() {
var range = new CKEDITOR.dom.range( doc ),
start = new CKEDITOR.dom.element( 'a', doc );

doc.getBody().append( start );

range._setStartContainer( start );
assert.areSame( start, range.startContainer );
},
Expand All @@ -267,6 +284,8 @@
var range = new CKEDITOR.dom.range( doc ),
end = new CKEDITOR.dom.element( 'a', doc );

doc.getBody().append( end );

range._setEndContainer( end );
assert.areSame( end, range.endContainer );
}
Expand Down
6 changes: 6 additions & 0 deletions tests/core/htmldataprocessor.js
Expand Up @@ -498,6 +498,12 @@
}
},

// #13233
'test don\'t protect foo:href attributes': function() {
assert.areSame( '<a foo:href="http://ckeditor.com">foo</a>',
bender.tools.fixHtml( this.editor.dataProcessor.toHtml( '<a foo:href="http://ckeditor.com">foo</a>' ) ) );
},

// #4243
'test custom protected source': function() {
var source = '<p>some<protected>protected</protected>text</p>';
Expand Down

0 comments on commit ca891bb

Please sign in to comment.