public/ckeditor/4.4dev/core/filter.js
function filterElement( that, element, opts ) {
		var name = element.name,
			privObj = that._,
			allowedRules = privObj.allowedRules.elements[ name ],
			genericAllowedRules = privObj.allowedRules.generic,
			disallowedRules = privObj.disallowedRules.elements[ name ],
			genericDisallowedRules = privObj.disallowedRules.generic,
			skipRequired = opts.skipRequired,
			status = {
				// Whether any of rules accepted element.
				// If not - it will be stripped.
				valid: false,
				// Objects containing accepted attributes, classes and styles.
				validAttributes: {},
				validClasses: {},
				validStyles: {},
				// Whether all are valid.
				// If we know that all element's attrs/classes/styles are valid
				// we can skip their validation, to improve performance.
				allAttributes: false,
				allClasses: false,
				allStyles: false,
				// Whether element had (before applying DACRs) at least one invalid attribute/class/style.
				hadInvalidAttribute: false,
				hadInvalidClass: false,
				hadInvalidStyle: false
			},
			i, l;

		// Early return - if there are no rules for this element (specific or generic), remove it.
		if ( !allowedRules && !genericAllowedRules )
			return null;

		// Could not be done yet if there were no transformations and if this
		// is real (not mocked) object.
		populateProperties( element );

		// Note - this step modifies element's styles, classes and attributes.
		if ( disallowedRules ) {
			for ( i = 0, l = disallowedRules.length; i < l; ++i ) {
				// Apply rule and make an early return if false is returned what means
				// that element is completely disallowed.
				if ( applyDisallowedRule( disallowedRules[ i ], element, status ) === false )
					return null;
			}
		}

		// Note - this step modifies element's styles, classes and attributes.
		if ( genericDisallowedRules ) {
			for ( i = 0, l = genericDisallowedRules.length; i < l; ++i )
				applyDisallowedRule( genericDisallowedRules[ i ], element, status );
		}

		if ( allowedRules ) {
			for ( i = 0, l = allowedRules.length; i < l; ++i )
				applyAllowedRule( allowedRules[ i ], element, status, skipRequired );
		}

		if ( genericAllowedRules ) {
			for ( i = 0, l = genericAllowedRules.length; i < l; ++i )
				applyAllowedRule( genericAllowedRules[ i ], element, status, skipRequired );
		}

		return status;
	}
function filterElement( that, element, opts ) {
		var name = element.name,
			privObj = that._,
			allowedRules = privObj.allowedRules.elements[ name ],
			genericAllowedRules = privObj.allowedRules.generic,
			disallowedRules = privObj.disallowedRules.elements[ name ],
			genericDisallowedRules = privObj.disallowedRules.generic,
			skipRequired = opts.skipRequired,
			status = {
				// Whether any of rules accepted element.
				// If not - it will be stripped.
				valid: false,
				// Objects containing accepted attributes, classes and styles.
				validAttributes: {},
				validClasses: {},
				validStyles: {},
				// Whether all are valid.
				// If we know that all element's attrs/classes/styles are valid
				// we can skip their validation, to improve performance.
				allAttributes: false,
				allClasses: false,
				allStyles: false,
				// Whether element had (before applying DACRs) at least one invalid attribute/class/style.
				hadInvalidAttribute: false,
				hadInvalidClass: false,
				hadInvalidStyle: false
			},
			i, l;

		// Early return - if there are no rules for this element (specific or generic), remove it.
		if ( !allowedRules && !genericAllowedRules )
			return null;

		// Could not be done yet if there were no transformations and if this
		// is real (not mocked) object.
		populateProperties( element );

		// Note - this step modifies element's styles, classes and attributes.
		if ( disallowedRules ) {
			for ( i = 0, l = disallowedRules.length; i < l; ++i ) {
				// Apply rule and make an early return if false is returned what means
				// that element is completely disallowed.
				if ( applyDisallowedRule( disallowedRules[ i ], element, status ) === false )
					return null;
			}
		}

		// Note - this step modifies element's styles, classes and attributes.
		if ( genericDisallowedRules ) {
			for ( i = 0, l = genericDisallowedRules.length; i < l; ++i )
				applyDisallowedRule( genericDisallowedRules[ i ], element, status );
		}

		if ( allowedRules ) {
			for ( i = 0, l = allowedRules.length; i < l; ++i )
				applyAllowedRule( allowedRules[ i ], element, status, skipRequired );
		}

		if ( genericAllowedRules ) {
			for ( i = 0, l = genericAllowedRules.length; i < l; ++i )
				applyAllowedRule( genericAllowedRules[ i ], element, status, skipRequired );
		}

		return status;
	}
function filterElement ( that , element , opts ) { var name = element . name , privObj = that . _ , allowedRules = privObj . allowedRules . elements [ name ] , genericAllowedRules = privObj . allowedRules . generic , disallowedRules = privObj . disallowedRules . elements [ name ] , genericDisallowedRules = privObj . disallowedRules . generic , skipRequired = opts . skipRequired , status = { // Whether any of rules accepted element. // If not - it will be stripped. valid : false , // Objects containing accepted attributes, classes and styles. validAttributes : { } , validClasses : { } , validStyles : { } , // Whether all are valid. // If we know that all element's attrs/classes/styles are valid // we can skip their validation, to improve performance. allAttributes : false , allClasses : false , allStyles : false , // Whether element had (before applying DACRs) at least one invalid attribute/class/style. hadInvalidAttribute : false , hadInvalidClass : false , hadInvalidStyle : false } , i , l ; // Early return - if there are no rules for this element (specific or generic), remove it. if ( ! allowedRules && ! genericAllowedRules ) return null ; // Could not be done yet if there were no transformations and if this // is real (not mocked) object. populateProperties ( element ) ; // Note - this step modifies element's styles, classes and attributes. if ( disallowedRules ) { for ( i = 0 , l = disallowedRules . length ; i < l ; ++ i ) { // Apply rule and make an early return if false is returned what means // that element is completely disallowed. if ( applyDisallowedRule ( disallowedRules [ i ] , element , status ) === false ) return null ; } } // Note - this step modifies element's styles, classes and attributes. if ( genericDisallowedRules ) { for ( i = 0 , l = genericDisallowedRules . length ; i < l ; ++ i ) applyDisallowedRule ( genericDisallowedRules [ i ] , element , status ) ; } if ( allowedRules ) { for ( i = 0 , l = allowedRules . length ; i < l ; ++ i ) applyAllowedRule ( allowedRules [ i ] , element , status , skipRequired ) ; } if ( genericAllowedRules ) { for ( i = 0 , l = genericAllowedRules . length ; i < l ; ++ i ) applyAllowedRule ( genericAllowedRules [ i ] , element , status , skipRequired ) ; } return status ; }
Does the actual filtering by appling allowed content rules to the element.  @param {CKEDITOR.filter} that The context. @param {CKEDITOR.htmlParser.element} element @param {Object} opts The same as in processElement.
Does the actual filtering by appling allowed content rules to the element .