SUMMARY SPAW is one of the better free wysiwyg editors for web forms. Safari 4 fails to initialize more than one instance of the editor on a page, resulting in unusable text entry forms on all sites out there that use the editor this way. STEPS TO REPRODUCE 1) Visit the product's multiple instance demo page at http://www.solmetra.com/en/disp.php/en_products/en_spaw/en_spaw_demo?page=2 2) Try using the topmost editor area. EXPECTED RESULTS Both editor areas, including all their tabbed pages, should initialize and be ready for text input. ACTUAL RESULTS Only one instance of the editor gets initialized, when there are more than one. The Javascript engine throws a number of errors in the console and the other editors remain inaccessible. REGRESSION Works as expected in Safari 3, Chrome 1.0 , Firefox 2-3.1, Opera 9+ and IE 6-8. ( This was also filed as rdar://6630909 )
Textareas, rather than 'forms' to be exact.
With ToT, I'm also getting toolbar misplaced.
<rdar://problem/6674182>
> With ToT, I'm also getting toolbar misplaced. Actually not, that's a feature - I expected the toolbar to be positioned above the text input area, but it floats freely in fact.
Here is the failing function: SpawEditor.prototype.onLoadHookup = function() { var spaw_tmpstr=""; if (window.onload != null) { spaw_tmpstr = window.onload.toString(); var spaw_i = spaw_tmpstr.indexOf("{") + 2; spaw_tmpstr = spaw_tmpstr.substr(spaw_i,spaw_tmpstr.length-spaw_i-2); } window.onload = new Function(this.name+'_obj.initialize();'+spaw_tmpstr); } The problem is that Function.toString() works differently now, so this produces a broken script. The general issue with Function.toString() is tracked as bug 18990.
Created attachment 28753 [details] reduction
I'll take this bug.
Created attachment 28774 [details] Proposed patch Not having a newline after the opening "{" is throwing this line off: var spaw_i = spaw_tmpstr.indexOf("{") + 2; The fix is to add a newline after the "{". I'll make a layout test and post it for review.
Created attachment 28777 [details] Proposed patch (with tests)
Comment on attachment 28777 [details] Proposed patch (with tests) r=me
Landed in r41851.