Skip to content

Commit

Permalink
Merge branch 't/9504'
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed May 8, 2014
2 parents 455f76d + b6b302a commit 997eff8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -25,6 +25,7 @@ Fixed Issues:
Other changes:

* [#11807](http://dev.ckeditor.com/ticket/11807): Updated jQuery version used in sample to 1.11.0 and tested CKEditor jQuery adapter with version 1.11.0 and 2.1.0.
* [#9504](http://dev.ckeditor.com/ticket/9504): Stop using deprecated attribute.specified on all browsers except IE.

## CKEditor 4.4

Expand Down
16 changes: 13 additions & 3 deletions core/dom/element.js
Expand Up @@ -985,7 +985,16 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {
hasAttribute: ( function() {
function standard( name ) {
var $attr = this.$.attributes.getNamedItem( name );
return !!( $attr && $attr.specified );

if ( !$attr )
return false;
else if ( CKEDITOR.env.ie )
return $attr.specified;
else {
// On other browsers specified property is deprecated and return always true,
// but fortunately $.attributes contains only specified attributes.
return true;
}
}

return ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) ?
Expand Down Expand Up @@ -1668,8 +1677,9 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, {

if ( attrName == 'checked' && ( attrValue = this.getAttribute( attrName ) ) )
dest.setAttribute( attrName, attrValue );
// IE BUG: value attribute is never specified even if it exists.
else if ( attribute.specified || ( CKEDITOR.env.ie && attribute.nodeValue && attrName == 'value' ) ) {
// IE contains not specified attributes in $.attributes so we need to check
// if elements attribute is specified using hasAttribute.
else if ( !CKEDITOR.env.ie || this.hasAttribute( attrName ) ) {
attrValue = this.getAttribute( attrName );
if ( attrValue === null )
attrValue = attribute.nodeValue;
Expand Down

0 comments on commit 997eff8

Please sign in to comment.