Ticket #3500: 3500_2.patch

File 3500_2.patch, 2.0 KB (added by Frederico Caldeira Knabben, 15 years ago)
  • _source/core/dom/element.js

     
    800800                        :
    801801                                function()
    802802                                {
    803                                         return this.$.attributes.length > 0;
     803                                        var attributes = this.$.attributes;
     804                                        return ( attributes.length > 1 || ( attributes.length == 1 && attributes[0].nodeName != '_cke_expando' ) );
    804805                                },
    805806
    806807                /**
     
    954955                                {
    955956                                        if ( name == 'class' )
    956957                                                name = 'className';
     958                                        else if ( name == 'tabindex' )
     959                                                name = 'tabIndex';
    957960                                        standard.call( this, name );
    958961                                };
    959962                        }
  • _source/tests/core/dom/element.html

     
    407407                test_getAttribute_ignoreExpandoAttributes : function()
    408408                {
    409409                        var element = new CKEDITOR.dom.element( document.getElementById( 'testExpandoAttributes' ) );
    410                         assert.areEqual( 1, element.getAttribute( 'tabindex' ) );
     410
     411                        assert.areEqual( 1, element.getAttribute( 'tabindex' ), 'tabindex is wrong' );
    411412                        element.removeAttribute( 'tabindex' );
    412                         assert.areEqual( 'hasExpando', element.getAttribute( 'class' ) );
     413
     414                        assert.areEqual( 'hasExpando', element.getAttribute( 'class' ), 'class is wrong' );
    413415                        element.removeAttribute( 'class' );
    414                         if( CKEDITOR.env.ie )
    415                                 assert.areEqual( 'FLOAT: right', element.getAttribute( 'style' ) );
    416                         else
    417                                 assert.areEqual( 'float: right;', element.getAttribute( 'style' ) );
     416
     417                        assert.areEqual( 'float:right', element.getAttribute( 'style' ).toLowerCase().replace( /[ ;]/g, '' ) );
     418
    418419                        element.removeAttribute( 'style' );
    419420                        element.removeAttribute( 'id' );
    420                         assert.isFalse( element.hasAttributes() );
     421                        assert.isFalse( element.hasAttributes(), 'hasAttributes should be false' );
    421422                },
    422423
    423424                test_getTabIndex1 : function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy