diff --git a/core/htmlparser/element.js b/core/htmlparser/element.js
index 971504d8acd..5e8a04790bd 100644
--- a/core/htmlparser/element.js
+++ b/core/htmlparser/element.js
@@ -229,6 +229,10 @@ CKEDITOR.htmlParser.cssStyle = function() {
if ( i == 1 )
attribsArray.push( [ a, value ] );
else if ( filter ) {
+ // Loop until name isn't modified.
+ // A little bit senseless, but IE would do that anyway
+ // because it iterates with for-in loop even over properties
+ // created during its run.
while ( true ) {
if ( !( newAttrName = filter.onAttributeName( a ) ) ) {
delete attributes[ a ];
diff --git a/core/htmlparser/filter.js b/core/htmlparser/filter.js
index e462695274f..05535a31718 100644
--- a/core/htmlparser/filter.js
+++ b/core/htmlparser/filter.js
@@ -146,7 +146,7 @@
if ( itemsLength ) {
// Find the index to insert the items at.
- for ( i = 0; i < listLength && list[ i ].pri < priority; i++ ) {
+ for ( i = 0; i < listLength && list[ i ].pri <= priority; i++ ) {
/*jsl:pass*/
}