Ticket #3500: 3500.patch

File 3500.patch, 1.8 KB (added by Alfonso Martínez de Lizarrondo, 16 years ago)

Proposed patch

  • _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                /**
  • _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' ) );
    411                         element.removeAttribute( 'tabindex' );
     410                        assert.areEqual( 1, element.getAttribute( 'tabIndex' ) );
     411                        element.removeAttribute( 'tabIndex' );
    412412                        assert.areEqual( 'hasExpando', element.getAttribute( 'class' ) );
    413413                        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' ) );
     414
     415                        var floatStyle;
     416                        if ( CKEDITOR.env.gecko )
     417                                floatStyle = 'float: right;';
     418                        if ( CKEDITOR.env.ie )
     419                                floatStyle = 'FLOAT: right';
     420                        if ( CKEDITOR.env.opera )
     421                                floatStyle = 'float:right';
     422                        if ( CKEDITOR.env.webkit )
     423                                floatStyle = 'float:right';
     424       
     425                        assert.areEqual( floatStyle, element.getAttribute( 'style' ) );
    418426                        element.removeAttribute( 'style' );
    419427                        element.removeAttribute( 'id' );
    420428                        assert.isFalse( element.hasAttributes() );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy