JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.1
[ckeditor.git] / _source / core / dom / element.js
index 2f3eb0a..5df3d19 100644 (file)
@@ -429,6 +429,13 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                                                        name = 'className';\r
                                                        break;\r
 \r
+                                               case 'http-equiv':\r
+                                                       name = 'httpEquiv';\r
+                                                       break;\r
+\r
+                                               case 'name':\r
+                                                       return this.$.name;\r
+\r
                                                case 'tabindex':\r
                                                        var tabIndex = standard.call( this, name );\r
 \r
@@ -714,6 +721,9 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
 \r
                isEditable : function()\r
                {\r
+                       if ( this.isReadOnly() )\r
+                               return false;\r
+\r
                        // Get the element name.\r
                        var name = this.getName();\r
 \r
@@ -884,11 +894,28 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                 * @param {String} name The attribute name.\r
                 * @example\r
                 */\r
-               hasAttribute : function( name )\r
+               hasAttribute : (function()\r
                {\r
-                       var $attr = this.$.attributes.getNamedItem( name );\r
-                       return !!( $attr && $attr.specified );\r
-               },\r
+                       function standard( name )\r
+                       {\r
+                               var $attr = this.$.attributes.getNamedItem( name );\r
+                               return !!( $attr && $attr.specified );\r
+                       }\r
+\r
+                       return ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) ?\r
+                                       function( name )\r
+                                       {\r
+                                               // On IE < 8 the name attribute cannot be retrieved\r
+                                               // right after the element creation and setting the\r
+                                               // name with setAttribute.\r
+                                               if ( name == 'name' )\r
+                                                       return !!this.$.name;\r
+\r
+                                               return standard.call( this, name );\r
+                                       }\r
+                               :\r
+                                       standard;\r
+               })(),\r
 \r
                /**\r
                 * Hides this element (display:none).\r
@@ -1035,6 +1062,18 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                                        return this;\r
                                };\r
                        }\r
+                       else if ( CKEDITOR.env.ie8Compat && CKEDITOR.env.secure )\r
+                       {\r
+                               return function( name, value )\r
+                               {\r
+                                       // IE8 throws error when setting src attribute to non-ssl value. (#7847)\r
+                                       if ( name == 'src' && value.match( /^http:\/\// ) )\r
+                                               try { standard.apply( this, arguments ); } catch( e ){}\r
+                                       else\r
+                                               standard.apply( this, arguments );\r
+                                       return this;\r
+                               };\r
+                       }\r
                        else\r
                                return standard;\r
                })(),\r
@@ -1556,7 +1595,13 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
                 */\r
                getDirection : function( useComputed )\r
                {\r
-                       return useComputed ? this.getComputedStyle( 'direction' ) : this.getStyle( 'direction' ) || this.getAttribute( 'dir' );\r
+                       return useComputed ?\r
+                               this.getComputedStyle( 'direction' )\r
+                                       // Webkit: offline element returns empty direction (#8053).\r
+                                       || this.getDirection()\r
+                                       || this.getDocument().$.dir\r
+                                       || this.getDocument().getBody().getDirection( 1 )\r
+                               : this.getStyle( 'direction' ) || this.getAttribute( 'dir' );\r
                },\r
 \r
                /**\r