RESOLVED FIXED Bug 24350
REGRESSION: Safari 4 breaks SPAW wysiwyg editor multiple instances
https://bugs.webkit.org/show_bug.cgi?id=24350
Summary REGRESSION: Safari 4 breaks SPAW wysiwyg editor multiple instances
Jon Fabritius
Reported 2009-03-04 06:36:54 PST
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 )
Attachments
reduction (529 bytes, text/html)
2009-03-19 08:33 PDT, Alexey Proskuryakov
no flags
Proposed patch (915 bytes, patch)
2009-03-19 17:53 PDT, Cameron Zwarich (cpst)
no flags
Proposed patch (with tests) (5.41 KB, patch)
2009-03-19 18:46 PDT, Cameron Zwarich (cpst)
oliver: review+
Jon Fabritius
Comment 1 2009-03-05 00:16:08 PST
Textareas, rather than 'forms' to be exact.
Alexey Proskuryakov
Comment 2 2009-03-05 04:52:47 PST
With ToT, I'm also getting toolbar misplaced.
Alexey Proskuryakov
Comment 3 2009-03-12 02:41:32 PDT
Alexey Proskuryakov
Comment 4 2009-03-19 07:48:54 PDT
> 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.
Alexey Proskuryakov
Comment 5 2009-03-19 08:29:48 PDT
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.
Alexey Proskuryakov
Comment 6 2009-03-19 08:33:41 PDT
Created attachment 28753 [details] reduction
Cameron Zwarich (cpst)
Comment 7 2009-03-19 17:19:01 PDT
I'll take this bug.
Cameron Zwarich (cpst)
Comment 8 2009-03-19 17:53:42 PDT
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.
Cameron Zwarich (cpst)
Comment 9 2009-03-19 18:46:33 PDT
Created attachment 28777 [details] Proposed patch (with tests)
Geoffrey Garen
Comment 10 2009-03-19 19:02:02 PDT
Comment on attachment 28777 [details] Proposed patch (with tests) r=me
Cameron Zwarich (cpst)
Comment 11 2009-03-19 19:05:35 PDT
Landed in r41851.
Note You need to log in before you can comment on or make changes to this bug.