Ticket #3549: 3549_4.patch
File 3549_4.patch, 2.4 KB (added by , 16 years ago) |
---|
-
_source/core/dom/element.js
151 151 */ 152 152 removeClass : function( className ) 153 153 { 154 var c = this. $.className;154 var c = this.getAttribute( 'class' ); 155 155 if ( c ) 156 156 { 157 var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', ' ' );157 var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', 'i' ); 158 158 if ( regex.test( c ) ) 159 159 { 160 160 c = c.replace( regex, '' ).replace( /^\s+/, '' ); 161 161 162 162 if ( c ) 163 this. $.className = c;163 this.setAttribute( 'class', c ); 164 164 else 165 165 this.removeAttribute( 'class' ); 166 166 } … … 170 170 hasClass : function( className ) 171 171 { 172 172 var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', '' ); 173 return regex.test( this. $.className);173 return regex.test( this.getAttribute('class') ); 174 174 }, 175 175 176 176 /** … … 400 400 return this.$.getAttribute( name, 2 ); 401 401 }; 402 402 403 if ( CKEDITOR.env.ie && !CKEDITOR.env.ie8)403 if ( CKEDITOR.env.ie ) 404 404 { 405 405 return function( name ) 406 406 { … … 436 436 /([^;])$/, '$1;'); 437 437 } 438 438 439 return standard.call( this, name ); 439 return typeof this.$[ name ] == 'undefined' 440 ? standard.call( this, name ) : this.$[ name ]; 440 441 }; 441 442 } 442 443 else … … 767 768 // outerHTML of the element is not displaying the class attribute. 768 769 // Note : I was not able to reproduce it outside the editor, 769 770 // but I've faced it while working on the TC of #1391. 770 if ( this. $.className.length> 0 )771 if ( this.getAttribute( 'class' ) > 0 ) 771 772 return true; 772 773 773 774 // Attributes to be ignored. … … 870 871 return this; 871 872 }; 872 873 873 if ( CKEDITOR.env.ie && !CKEDITOR.env.ie8)874 if ( CKEDITOR.env.ie ) 874 875 { 875 876 return function( name, value ) 876 877 { … … 936 937 this.$.removeAttribute( name ); 937 938 }; 938 939 939 if ( CKEDITOR.env.ie && !CKEDITOR.env.ie8)940 if ( CKEDITOR.env.ie ) 940 941 { 941 942 return function( name ) 942 943 { 943 944 if ( name == 'class' ) 945 { 946 this.className = undefined; 947 standard.call( this, 'class' ); 944 948 name = 'className'; 949 } 945 950 else if ( name == 'tabindex' ) 946 951 name = 'tabIndex'; 947 952 standard.call( this, name );