Ticket #2150 (closed Bug: fixed)

Opened 3 weeks ago

Last modified 4 days ago

Find dialog hangs when searching for word not found in a larger text

Reported by: jonhg Assigned to: martinkou
Priority: Normal Milestone: FCKeditor 2.6.1
Component: General Version: SVN
Keywords: Confirmed Review+ Cc:

Description

Scenario:

  1. Paste a larger text into the editor (i.e. the gpl license http://www.gnu.org/licenses/gpl-3.0.txt)
  2. Open the find dialog and search for word not found in the text.
  3. The scripts hangs and after a while the browser ask to stop the script.

Tested in nightly build with firefox on linux and ie7 on windows.

Attachments

2150_pre.patch (20.7 kB) - added by martinkou on 04/29/08 07:29:03.
2150.patch (22.4 kB) - added by martinkou on 04/29/08 09:17:42.
2150_2.patch (22.3 kB) - added by martinkou on 04/29/08 10:12:58.
2150_3.patch (22.3 kB) - added by martinkou on 04/29/08 11:49:52.
2150_4.patch (22.5 kB) - added by martinkou on 05/08/08 11:02:28.
2150_5.patch (22.6 kB) - added by martinkou on 05/09/08 11:39:20.
2150_6.patch (22.6 kB) - added by martinkou on 05/09/08 11:47:59.

Change History

04/22/08 15:10:46 changed by martinkou

  • keywords set to Confirmed.
  • version set to SVN.
  • milestone set to FCKeditor 2.6.1.

Confirmed. It's a pretty major bug so I'm targeting it to 2.6.1.

04/22/08 15:15:30 changed by martinkou

btw the search seems to have gotten stuck somewhere in the middle of the GNU license so I'm quite sure this is a bug rather than a speed issue.

04/22/08 15:17:37 changed by w.olchawa

Tested on IE6, IE7 and FF2 - in all of my tests the browsers collapsed.

04/24/08 08:24:36 changed by martinkou

  • owner set to martinkou.
  • status changed from new to assigned.

04/24/08 09:19:01 changed by martinkou

I was wrong yesterday. Further tests indicated that the search logic didn't actually got stuck, but the GetData() function took longer and longer to execute per call as the search proceeds down the document.

04/29/08 07:29:03 changed by martinkou

  • attachment 2150_pre.patch added.

04/29/08 07:35:34 changed by martinkou

I've written a preliminary patch which re-implements the finding logic of the Find/Replace dialog. Improvements include:

  1. A factor-of-ten or greater improvement in searching performance, which eliminates the freeze up in searching long documents like the GPL 3.0. Note that while the new implementation would no longer hang scanning the GPL 3.0, it would still hang if given a much larger document - any classical search function still has to scan every DOM node and every character of the document no matter how fast it is, we aren't using quantum computers/quantum algorithms yet ;).
  2. Reduced code size of fck_replace.html, because the new algorithm is simpler.

04/29/08 07:36:25 changed by martinkou

The preliminary patch should be nearly completely functional, the only thing that doesn't work yet is the "Match whole word" option.

04/29/08 09:09:26 changed by martinkou

#2159 and #2160 are related to this ticket.

04/29/08 09:17:42 changed by martinkou

  • attachment 2150.patch added.

04/29/08 09:18:02 changed by martinkou

  • keywords changed from Confirmed to Confirmed Review?.

04/29/08 10:12:58 changed by martinkou

  • attachment 2150_2.patch added.

04/29/08 10:13:55 changed by martinkou

Updated patch which removes the FCKDomTools.ScrollIntoView() hack for Safari in the Find/Replace dialog, because the hack was found to not work.

04/29/08 11:49:52 changed by martinkou

  • attachment 2150_3.patch added.

04/29/08 11:50:39 changed by martinkou

Updated the patch again because the match whole word option was found to not work after the search has scanned through the document the first time.

05/08/08 10:21:12 changed by fredck

  • keywords changed from Confirmed Review? to Confirmed Review-.

The patch is breaking simple searchs. Just try to search for "a", hitting the search button several times. It will throw a js error.

05/08/08 11:02:28 changed by martinkou

  • attachment 2150_4.patch added.

05/08/08 11:03:16 changed by martinkou

  • keywords changed from Confirmed Review- to Confirmed Review?.

05/09/08 11:39:20 changed by martinkou

  • attachment 2150_5.patch added.

05/09/08 11:47:59 changed by martinkou

  • attachment 2150_6.patch added.

05/09/08 11:54:49 changed by fredck

  • keywords changed from Confirmed Review? to Confirmed Review+.

05/09/08 11:58:05 changed by martinkou

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed with [1973].

Click here for more info about our SVN system.