Ticket #3591: 3591_5.patch
File 3591_5.patch, 6.1 KB (added by , 15 years ago) |
---|
-
_source/tests/plugins/htmldataprocessor/htmldataprocessor.html
242 242 assert.areSame( html , dataProcessor.toDataFormat( protectedHtml ) ); 243 243 }, 244 244 245 test_ticket_3591 : function() 246 { 247 var editor = CKEDITOR.instances.editor1, 248 dataProcessor = editor.dataProcessor; 249 250 dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter(); 251 var html = getTextAreaValue( '_TEXTAREA_3591' ); 252 var protectedHtml = dataProcessor.toHtml( html ); 253 254 assert.areSame( getTextAreaValue( '_TEXTAREA_3591_protected' ), 255 protectedHtml ); 256 assert.areSame( getTextAreaValue( '_TEXTAREA_3591' ), 257 dataProcessor.toDataFormat( protectedHtml ) ); 258 }, 259 260 test_ticket_3591_2_2 : function() 261 { 262 var editor = CKEDITOR.instances.editor1, 263 dataProcessor = editor.dataProcessor; 264 265 dataProcessor.writer = new CKEDITOR.htmlParser.basicWriter(); 266 var html = getTextAreaValue( '_TEXTAREA_3591_2' ); 267 var protectedHtml = dataProcessor.toHtml( html ); 268 269 assert.areSame( getTextAreaValue( '_TEXTAREA_3591_2' ), 270 dataProcessor.toDataFormat( protectedHtml ) ); 271 }, 272 245 273 name : document.title 246 274 }; 247 275 })() ); 248 276 249 //window.onload = testCase.test_ticket_3 407;277 //window.onload = testCase.test_ticket_3591; 250 278 //]]> 251 279 </script> 252 280 </head> … … 258 286 <![endif]> 259 287 <![endif]--><td><%Response.Write(now())%></td><td><asp:control_name id="some_id" runat="server"/></td><td><?php 260 288 include ("head.html"); ?></td></tr></tbody></table><noscript>Your browser doesn't support JavaScript</noscript></textarea> 289 <textarea id="_TEXTAREA_3591"><object><param /><param /><embed></embed></object></textarea> 290 <textarea id="_TEXTAREA_3591_protected"><cke:object><cke:param></cke:param><cke:param></cke:param><cke:embed></cke:embed></cke:object></textarea> 291 <textarea id="_TEXTAREA_3591_2"><object classid="clsid"><param name="movie" value="movie.swf" /><embed src="movie.swf" type="application/x-shockwave-flash"></embed></object></textarea> 261 292 </body> 262 293 </html> -
_source/plugins/flash/plugin.js
19 19 { 20 20 var attributes = element.attributes; 21 21 22 return ( attributes.type != 'application/x-shockwave-flash' || !flashFilenameRegex.test( attributes.src || '' ) );22 return ( attributes.type == 'application/x-shockwave-flash' || flashFilenameRegex.test( attributes.src || '' ) ); 23 23 } 24 24 25 25 function createFakeElement( editor, realElement ) -
_source/plugins/htmldataprocessor/plugin.js
72 72 delete blockLikeTags.pre; 73 73 var defaultDataFilterRules = 74 74 { 75 elementNames :76 [77 // Elements that cause problems in wysiwyg mode.78 [ ( /^(object|embed|param)$/ ), 'cke:$1' ]79 ],80 81 75 attributeNames : 82 76 [ 83 77 // Event attributes (onXYZ) must not be directly set. They can become … … 132 126 // and height attributes from it. 133 127 if ( parent && parent.name == 'object' ) 134 128 { 135 element.attributes.width = parent.attributes.width; 136 element.attributes.height = parent.attributes.height; 129 var parentWidth = parent.attributes.width, 130 parentHeight = parent.attributes.height; 131 parentWidth && ( element.attributes.width = parentWidth ); 132 parentHeight && ( element.attributes.height = parentHeight ); 137 133 } 138 134 }, 139 135 136 // Restore param elements into self-closing. 137 param : function( param ) 138 { 139 param.children = []; 140 param.isEmpty = true; 141 return param; 142 }, 143 140 144 img : function( element ) 141 145 { 142 146 var attribs = element.attributes; … … 197 201 } 198 202 199 203 var protectAttributeRegex = /<(?:a|area|img|input).*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi; 200 204 var protectElementNamesRegex = /(<[/]?)(object|embed|param)(.*?>)/gi; 205 var protectSelfClosingRegex = /(<)(cke:param)(.*?)\/(>)/gi; 201 206 function protectAttributes( html ) 202 207 { 203 208 return html.replace( protectAttributeRegex, '$& _cke_saved_$1' ); … … 215 220 { 216 221 return html.replace( protectStyleTagsRegex, protectStyleTagsMatch ); 217 222 } 223 function protectElementsNames( html ) 224 { 225 return html.replace( protectElementNamesRegex, '$1cke:$2$3'); 226 } 227 function protectSelfClosingElements( html ) 228 { 229 return html.replace( protectSelfClosingRegex, '$1$2$3$4$1/$2$4' ); 230 } 218 231 219 232 function unprotectEncodedTagsMatch( match, encoded ) 220 233 { … … 298 311 if ( CKEDITOR.env.ie ) 299 312 data = protectStyleTags( data ); 300 313 314 // Certain elements has problem to go through DOM operation, protect 315 // them by prefixing 'cke' namespace. 316 data = protectElementsNames( data ); 317 318 // All none-IE browsers ignore self-closed custom elements, 319 // protecting them into open-close. 320 data = protectSelfClosingElements( data ); 321 301 322 // Call the browser to help us fixing a possibly invalid HTML 302 323 // structure. 303 324 var div = document.createElement( 'div' ); -
CHANGES.html
60 60 <li><a href="http://dev.fckeditor.net/ticket/3835">#3835</a> : Element path is not refreshed 61 61 after click on 'newpage'; and safari is not putting focus on document also. 62 62 </li> 63 <li><a href="http://dev.fckeditor.net/ticket/3591">#3591</a> : Protecting flash related elements 64 including '<object>', '<embed>' and '<param>'. 65 </li> 63 66 </ul> 64 67 <h3> 65 68 CKEditor 3.0 RC</h3>