JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.1
[ckeditor.git] / _source / core / dom / element.js
index 0243dea..18c56e6 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -452,7 +452,8 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                                                }\r
 \r
                                                case 'hspace':\r
-                                                       return this.$.hspace;\r
+                                               case 'value':\r
+                                                       return this.$[ name ];\r
 \r
                                                case 'style':\r
                                                        // IE does not return inline styles via getAttribute(). See #2947.\r
@@ -920,6 +921,9 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                        }\r
                },\r
 \r
+               /**\r
+                * @param {Boolean} [inlineOnly=true] Allow only inline elements to be merged.\r
+                */\r
                mergeSiblings : ( function()\r
                {\r
                        function mergeElements( element, sibling, isNext )\r
@@ -959,11 +963,14 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                                }\r
                        }\r
 \r
-                       return function()\r
+                       return function( inlineOnly )\r
                                {\r
-                                       // Merge empty links and anchors also. (#5567)\r
-                                       if ( !( CKEDITOR.dtd.$removeEmpty[ this.getName() ] || this.is( 'a' ) ) )\r
+                                       if ( ! ( inlineOnly === false\r
+                                                       || CKEDITOR.dtd.$removeEmpty[ this.getName() ]\r
+                                                       || this.is( 'a' ) ) )   // Merge empty links and anchors also. (#5567)\r
+                                       {\r
                                                return;\r
+                                       }\r
 \r
                                        mergeElements( this, this.getNext(), true );\r
                                        mergeElements( this, this.getPrevious() );\r
@@ -1560,6 +1567,8 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                                this.removeAttribute( name );\r
                        else\r
                                this.setAttribute( name, value );\r
+\r
+                       return null;\r
                }\r
        });\r
 \r