| 95 | /** |
| 96 | * Used to clean up HTML that has been processed FCKXHtml._AppendNode(). |
| 97 | * |
| 98 | * For objects corresponding to HTML elements, Internet Explorer will |
| 99 | * treat a property as if it were an attribute set on that element. |
| 100 | * |
| 101 | * http://msdn.microsoft.com/en-us/library/ms533026(VS.85).aspx#Accessing_Element_Pr |
| 102 | * |
| 103 | * FCKXHtml._AppendNode() sets the property _fckxhtmljob on node objects |
| 104 | * corresponding HTML elements to mark them as having been processed. |
| 105 | * Counting these properties as attributes will cripple style removal |
| 106 | * because FCK.Styles.RemoveFromSelection() will not remove an element |
| 107 | * as long as it still has attributes. |
| 108 | * |
| 109 | * refs #2156 and #2834 |
| 110 | */ |
| 111 | |
| 112 | FCKXHtml._RemoveXHtmlJobProperties = function ( node ) |
| 113 | { |
| 114 | // Protect against degenerate cases. |
| 115 | if ( ( typeof node !== 'object' ) || ( node === null ) ) |
| 116 | return ; |
| 117 | |
| 118 | // Protect against being passed a non-DOMNode object. |
| 119 | if ( typeof node.nodeType === 'undefined' ) |
| 120 | return ; |
| 121 | |
| 122 | // Select only nodes of type ELEMENT_NODE |
| 123 | if ( node.nodeType === 1 ) |
| 124 | { |
| 125 | |
| 126 | // Clear the _fckhtmljob attribute. |
| 127 | if ( typeof node._fckxhtmljob !== 'undefined' ) |
| 128 | node._fckhtmljob = null ; |
| 129 | |
| 130 | // Recurse upon child nodess. |
| 131 | if ( node.hasChildNodes() ) |
| 132 | { |
| 133 | var childNodes = node.childNodes ; |
| 134 | for ( var i = 0 ; i < childNodes.length ; ++i ) |
| 135 | FCKXHtml._RemoveXHtmlJobProperties( childNodes.item(i) ) ; |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |