Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2150 closed Bug (fixed)

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

Reported by: Jon Håvard Gundersen Owned by: Martin Kou
Priority: Normal Milestone: FCKeditor 2.6.1
Component: General Version: SVN (FCKeditor) - Retired
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 (7)

2150_pre.patch (20.7 KB) - added by Martin Kou 16 years ago.
2150.patch (22.4 KB) - added by Martin Kou 16 years ago.
2150_2.patch (22.3 KB) - added by Martin Kou 16 years ago.
2150_3.patch (22.3 KB) - added by Martin Kou 16 years ago.
2150_4.patch (22.5 KB) - added by Martin Kou 16 years ago.
2150_5.patch (22.6 KB) - added by Martin Kou 16 years ago.
2150_6.patch (22.6 KB) - added by Martin Kou 16 years ago.

Download all attachments as: .zip

Change History (23)

comment:1 Changed 16 years ago by Martin Kou

Keywords: Confirmed added
Milestone: FCKeditor 2.6.1
Version: SVN

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

comment:2 Changed 16 years ago by Martin Kou

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.

comment:3 Changed 16 years ago by Wojciech Olchawa

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

comment:4 Changed 16 years ago by Martin Kou

Owner: set to Martin Kou
Status: newassigned

comment:5 Changed 16 years ago by Martin Kou

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.

Changed 16 years ago by Martin Kou

Attachment: 2150_pre.patch added

comment:6 Changed 16 years ago by Martin Kou

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.

comment:7 Changed 16 years ago by Martin Kou

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

comment:8 Changed 16 years ago by Martin Kou

#2159 and #2160 are related to this ticket.

Changed 16 years ago by Martin Kou

Attachment: 2150.patch added

comment:9 Changed 16 years ago by Martin Kou

Keywords: Review? added

Changed 16 years ago by Martin Kou

Attachment: 2150_2.patch added

comment:10 Changed 16 years ago by Martin Kou

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

Changed 16 years ago by Martin Kou

Attachment: 2150_3.patch added

comment:11 Changed 16 years ago by Martin Kou

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.

comment:12 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

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

Changed 16 years ago by Martin Kou

Attachment: 2150_4.patch added

comment:13 Changed 16 years ago by Martin Kou

Keywords: Review? added; Review- removed

Changed 16 years ago by Martin Kou

Attachment: 2150_5.patch added

Changed 16 years ago by Martin Kou

Attachment: 2150_6.patch added

comment:14 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

comment:15 Changed 16 years ago by Martin Kou

Resolution: fixed
Status: assignedclosed

Fixed with [1973].

Click here for more info about our SVN system.

comment:16 Changed 16 years ago by Wojciech Olchawa

#2216 has been marked as DUP

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy