public/ckeditor/4.4dev/core/filter.js
function processElement( that, element, toBeRemoved, opts ) {
		var status,
			retVal = 0,
			callbacksRetVal;

		// Unprotect elements names previously protected by htmlDataProcessor
		// (see protectElementNames and protectSelfClosingElements functions).
		// Note: body, title, etc. are not protected by htmlDataP (or are protected and then unprotected).
		if ( opts.toHtml )
			element.name = element.name.replace( unprotectElementsNamesRegexp, '$1' );

		// Execute element callbacks and return if one of them returned any value.
		if ( opts.doCallbacks && that.elementCallbacks ) {
			// For now we only support here FILTER_SKIP_TREE, so we can early return if retVal is truly value.
			if ( ( callbacksRetVal = executeElementCallbacks( element, that.elementCallbacks ) ) )
				return callbacksRetVal;
		}

		// If transformations are set apply all groups.
		if ( opts.doTransform )
			transformElement( that, element );

		if ( opts.doFilter ) {
			// Apply all filters.
			status = filterElement( that, element, opts );

			// Handle early return from filterElement.
			if ( !status ) {
				toBeRemoved.push( element );
				return FILTER_ELEMENT_MODIFIED;
			}

			// Finally, if after running all filter rules it still hasn't been allowed - remove it.
			if ( !status.valid ) {
				toBeRemoved.push( element );
				return FILTER_ELEMENT_MODIFIED;
			}

			// Update element's attributes based on status of filtering.
			if ( updateElement( element, status ) )
				retVal = FILTER_ELEMENT_MODIFIED;

			if ( !opts.skipFinalValidation && !validateElement( element ) ) {
				toBeRemoved.push( element );
				return FILTER_ELEMENT_MODIFIED;
			}
		}

		// Protect previously unprotected elements.
		if ( opts.toHtml )
			element.name = element.name.replace( protectElementsNamesRegexp, 'cke:$1' );

		return retVal;
	}
function processElement( that, element, toBeRemoved, opts ) {
		var status,
			retVal = 0,
			callbacksRetVal;

		// Unprotect elements names previously protected by htmlDataProcessor
		// (see protectElementNames and protectSelfClosingElements functions).
		// Note: body, title, etc. are not protected by htmlDataP (or are protected and then unprotected).
		if ( opts.toHtml )
			element.name = element.name.replace( unprotectElementsNamesRegexp, '$1' );

		// Execute element callbacks and return if one of them returned any value.
		if ( opts.doCallbacks && that.elementCallbacks ) {
			// For now we only support here FILTER_SKIP_TREE, so we can early return if retVal is truly value.
			if ( ( callbacksRetVal = executeElementCallbacks( element, that.elementCallbacks ) ) )
				return callbacksRetVal;
		}

		// If transformations are set apply all groups.
		if ( opts.doTransform )
			transformElement( that, element );

		if ( opts.doFilter ) {
			// Apply all filters.
			status = filterElement( that, element, opts );

			// Handle early return from filterElement.
			if ( !status ) {
				toBeRemoved.push( element );
				return FILTER_ELEMENT_MODIFIED;
			}

			// Finally, if after running all filter rules it still hasn't been allowed - remove it.
			if ( !status.valid ) {
				toBeRemoved.push( element );
				return FILTER_ELEMENT_MODIFIED;
			}

			// Update element's attributes based on status of filtering.
			if ( updateElement( element, status ) )
				retVal = FILTER_ELEMENT_MODIFIED;

			if ( !opts.skipFinalValidation && !validateElement( element ) ) {
				toBeRemoved.push( element );
				return FILTER_ELEMENT_MODIFIED;
			}
		}

		// Protect previously unprotected elements.
		if ( opts.toHtml )
			element.name = element.name.replace( protectElementsNamesRegexp, 'cke:$1' );

		return retVal;
	}
function processElement ( that , element , toBeRemoved , opts ) { var status , retVal = 0 , callbacksRetVal ; // Unprotect elements names previously protected by htmlDataProcessor // (see protectElementNames and protectSelfClosingElements functions). // Note: body, title, etc. are not protected by htmlDataP (or are protected and then unprotected). if ( opts . toHtml ) element . name = element . name . replace ( unprotectElementsNamesRegexp , '$1' ) ; // Execute element callbacks and return if one of them returned any value. if ( opts . doCallbacks && that . elementCallbacks ) { // For now we only support here FILTER_SKIP_TREE, so we can early return if retVal is truly value. if ( ( callbacksRetVal = executeElementCallbacks ( element , that . elementCallbacks ) ) ) return callbacksRetVal ; } // If transformations are set apply all groups. if ( opts . doTransform ) transformElement ( that , element ) ; if ( opts . doFilter ) { // Apply all filters. status = filterElement ( that , element , opts ) ; // Handle early return from filterElement. if ( ! status ) { toBeRemoved . push ( element ) ; return FILTER_ELEMENT_MODIFIED ; } // Finally, if after running all filter rules it still hasn't been allowed - remove it. if ( ! status . valid ) { toBeRemoved . push ( element ) ; return FILTER_ELEMENT_MODIFIED ; } // Update element's attributes based on status of filtering. if ( updateElement ( element , status ) ) retVal = FILTER_ELEMENT_MODIFIED ; if ( ! opts . skipFinalValidation && ! validateElement ( element ) ) { toBeRemoved . push ( element ) ; return FILTER_ELEMENT_MODIFIED ; } } // Protect previously unprotected elements. if ( opts . toHtml ) element . name = element . name . replace ( protectElementsNamesRegexp , 'cke:$1' ) ; return retVal ; }
The actual function which filters, transforms and does other funny things with an element.  @param {CKEDITOR.filter} that Context. @param {CKEDITOR.htmlParser.element} element The element to be processed. @param {Array} toBeRemoved Array into which elements rejected by the filter will be pushed. @param {Boolean} [opts.doFilter] Whether element should be filtered. @param {Boolean} [opts.doTransform] Whether transformations should be applied. @param {Boolean} [opts.doCallbacks] Whether to execute element callbacks. @param {Boolean} [opts.toHtml] Set to true if filter used together with htmlDP#toHtml @param {Boolean} [opts.skipRequired] Whether element's required properties shouldn't be verified. @param {Boolean} [opts.skipFinalValidation] Whether to not perform final element validation (a,img). @returns {Number} Possible flags: * FILTER_ELEMENT_MODIFIED, * FILTER_SKIP_TREE.
The actual function which filters transforms and does other funny things with an element .