javascript regexp doesnt sort list items



14 years ago
12 years ago


(Reporter: Stuart Anderson, Unassigned)


Firefox Tracking Flags

(Not tracked)





14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

If you select one of the left frame menus, select a squaring for display and hit
the draw button, a squared square (or squared rectangle) is displayed in the
right frame menu.  Also the dimensions of the square or rectangle are displayed,
along with the bouwkampcode [concise notation describing the squaring], also a
list of the elements within the square or rectangle are given.  This is where
the bug is - the elements should be listed in ascending order by size, however
the Mozilla implementation of regexp doesnt perform the sorting. Other browsers
(IE, Netscape) handle the sorting correctly.

Reproducible: Always

Steps to Reproduce:
1. go to
2. click Simple Perfect Squares (spss) in left frame menu
3. click spss order 21 1/1 in left frame menu
4. click spss order 21 112 in left frame menu
5. click draw button in right top frame menu

Actual Results:  
The tiling is drawn correctly but the listing of Elements (to the right of the
tiling is unsorted) eg , 50, 35, 42, 29, 25, 15, 18, 27, 37, 24, 8, 19, 9, 2, 7,
17, 16, 11, 4, 6, 33

Expected Results:  
Mozilla should have sorted the Elements ie 2, 4, 6, 7, 8, 9, 11, 15, 16, 17, 18,
19, 24, 25, 27, 29, 33, 35, 37, 42, 50        

Below is some of the javascript, html and regexp used;

var com,dom,el,elem;

      com = /\)\(/g;

	dom = /,/g;

      el = Size.sort(max);

      elem = new String(el.toString());

the html is created from a javascript document.write() command.  The particular
part where the Elements appear is;
#### cut here ####
<td VALIGN="top"><SPAN style="font-family:Arial;
font-size:10pt">'+elem.replace(dom,", ")+'</SPAN></td></tr>
#### cut here ####

the complete javascript	can be viewed at
Product: Browser → Seamonkey
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Last Resolved: 12 years ago
Resolution: --- → EXPIRED
You need to log in before you can comment on or make changes to this bug.