public/ckeditor/4.4dev/core/filter.js
function( el, form ) {
			if ( typeof form == 'string' )
				el.name = form;
			// Form is an instance of CKEDITOR.style.
			else {
				var def = form.getDefinition(),
					defStyles = def.styles,
					defAttrs = def.attributes,
					attrName, styleName,
					existingClassesPattern, defClasses, cl;

				el.name = def.element;

				for ( attrName in defAttrs ) {
					if ( attrName == 'class' ) {
						existingClassesPattern = el.classes.join( '|' );
						defClasses = defAttrs[ attrName ].split( /\s+/ );

						while ( ( cl = defClasses.pop() ) ) {
							if ( existingClassesPattern.indexOf( cl ) == -1 )
								el.classes.push( cl );
						}
					} else {
						el.attributes[ attrName ] = defAttrs[ attrName ];
					}

				}

				for ( styleName in defStyles ) {
					el.styles[ styleName ] = defStyles[ styleName ];
				}
			}
		}
function( el, form ) {
			if ( typeof form == 'string' )
				el.name = form;
			// Form is an instance of CKEDITOR.style.
			else {
				var def = form.getDefinition(),
					defStyles = def.styles,
					defAttrs = def.attributes,
					attrName, styleName,
					existingClassesPattern, defClasses, cl;

				el.name = def.element;

				for ( attrName in defAttrs ) {
					if ( attrName == 'class' ) {
						existingClassesPattern = el.classes.join( '|' );
						defClasses = defAttrs[ attrName ].split( /\s+/ );

						while ( ( cl = defClasses.pop() ) ) {
							if ( existingClassesPattern.indexOf( cl ) == -1 )
								el.classes.push( cl );
						}
					} else {
						el.attributes[ attrName ] = defAttrs[ attrName ];
					}

				}

				for ( styleName in defStyles ) {
					el.styles[ styleName ] = defStyles[ styleName ];
				}
			}
		}
function ( el , form ) { if ( typeof form == 'string' ) el . name = form ; // Form is an instance of CKEDITOR.style. else { var def = form . getDefinition ( ) , defStyles = def . styles , defAttrs = def . attributes , attrName , styleName , existingClassesPattern , defClasses , cl ; el . name = def . element ; for ( attrName in defAttrs ) { if ( attrName == 'class' ) { existingClassesPattern = el . classes . join ( '|' ) ; defClasses = defAttrs [ attrName ] . split ( / \s+ / ) ; while ( ( cl = defClasses . pop ( ) ) ) { if ( existingClassesPattern . indexOf ( cl ) == - 1 ) el . classes . push ( cl ) ; } } else { el . attributes [ attrName ] = defAttrs [ attrName ] ; } } for ( styleName in defStyles ) { el . styles [ styleName ] = defStyles [ styleName ] ; } } }
Transforms element to given form.

Form may be a:

* {@link CKEDITOR.style},
* string &ndash; the new name of an element.

@param {CKEDITOR.htmlParser.element} el
@param {CKEDITOR.style/String} form
Transforms element to given form .