Skip to content
Permalink
Browse files

Merge branch 't/11390'

  • Loading branch information...
Reinmar committed Feb 11, 2014
2 parents eab0180 + 319a31b commit de363497b818228340d474138209ff80b53100b6
Showing with 23 additions and 18 deletions.
  1. +2 −1 CHANGES.md
  2. +21 −17 plugins/xml/plugin.js
@@ -15,7 +15,8 @@ Fixed Issues:
* [#11508](http://dev.ckeditor.com/ticket/11508): Fixed: htmlDataProcessor discovering protected attributes within other attributes' values.
* [#11533](http://dev.ckeditor.com/ticket/11533): Widgets: Avoid recurring upcasts if DOM structure was modified during an upcast.
* [#11400](http://dev.ckeditor.com/ticket/11400): Fixed [`domObject.removeAllListeners`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.domObject-method-removeAllListeners) does not remove custom listeners completely.
* [#11493](http://dev.ckeditor.com/ticket/114093: Fixed [`selection.getRanges`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.selection-method-getRanges) does not override cached ranges when used with `onlyEditables` argument.
* [#11493](http://dev.ckeditor.com/ticket/11493): Fixed [`selection.getRanges`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.selection-method-getRanges) does not override cached ranges when used with `onlyEditables` argument.
* [#11390](http://dev.ckeditor.com/ticket/11390): All [XML](http://docs.ckeditor.com/#!/api/CKEDITOR.xml) plugin's methods work now on IE10+.

## CKEditor 4.3.2

@@ -28,9 +28,11 @@
baseXml = xmlObjectOrData;
else {
var data = ( xmlObjectOrData || '' ).replace( / /g, '\xA0' );
if ( window.DOMParser )
baseXml = ( new DOMParser() ).parseFromString( data, 'text/xml' );
else if ( window.ActiveXObject ) {

// Check ActiveXObject before DOMParser, because IE10+ support both, but
// there's no XPath support in DOMParser instance.
// Also, the only check for ActiveXObject which still works in IE11+ is with `in` operator.
if ( 'ActiveXObject' in window ) {
try {
baseXml = new ActiveXObject( 'MSXML2.DOMDocument' );
} catch ( e ) {
@@ -46,10 +48,14 @@
baseXml.loadXML( data );
}
}
else if ( window.DOMParser )
baseXml = ( new DOMParser() ).parseFromString( data, 'text/xml' );
}

/**
* The native XML (DOM document) used by the class instance.
*
* @property {Object}
*/
this.baseXml = baseXml;
};
@@ -74,10 +80,9 @@
var baseXml = this.baseXml;

if ( contextNode || ( contextNode = baseXml ) ) {
if ( CKEDITOR.env.ie || contextNode.selectSingleNode ) // IE
return contextNode.selectSingleNode( xpath );
else if ( baseXml.evaluate ) // Others
{
if ( 'selectSingleNode' in contextNode ) // IEs
return contextNode.selectSingleNode( xpath );
else if ( baseXml.evaluate ) { // Others
var result = baseXml.evaluate( xpath, contextNode, null, 9, null );
return ( result && result.singleNodeValue ) || null;
}
@@ -91,10 +96,10 @@
*
* // Create the XML instance.
* var xml = new CKEDITOR.xml( '<list><item id="test1" /><item id="test2" /></list>' );
* // Get the first <item> node.
* var itemNodes = xml.selectSingleNode( 'list/item' );
* // Get all <item> nodes.
* var itemNodes = xml.selectNodes( 'list/item' );
* // Alert "item" twice, one for each <item>.
* for ( var i = 0 ; i < itemNodes.length ; i++ )
* for ( var i = 0; i < itemNodes.length; i++ )
* alert( itemNodes[i].nodeName );
*
* @param {String} xpath The XPath query to execute.
@@ -108,10 +113,9 @@
nodes = [];

if ( contextNode || ( contextNode = baseXml ) ) {
if ( CKEDITOR.env.ie || contextNode.selectNodes ) // IE
return contextNode.selectNodes( xpath );
else if ( baseXml.evaluate ) // Others
{
if ( 'selectNodes' in contextNode ) // IEs
return contextNode.selectNodes( xpath );
else if ( baseXml.evaluate ) { // Others
var result = baseXml.evaluate( xpath, contextNode, null, 5, null );

if ( result ) {
@@ -146,10 +150,10 @@
if ( node ) {
node = node.firstChild;
while ( node ) {
if ( node.xml ) // IE
xml.push( node.xml );
if ( node.xml ) // IEs
xml.push( node.xml );
else if ( window.XMLSerializer ) // Others
xml.push( ( new XMLSerializer() ).serializeToString( node ) );
xml.push( ( new XMLSerializer() ).serializeToString( node ) );

node = node.nextSibling;
}

0 comments on commit de36349

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