Opened 14 years ago

Closed 14 years ago

#173 closed defect (fixed)

Stack overflow errors in IE related to context menus

Reported by: chrisclaydon Owned by: pagameba
Priority: P1 Milestone: 2.0
Component: Core Version: SVN
Severity: Major Keywords:
Cc: Browser: IE7
External ID: 1161259 Operating System: All
state: Analysing

Description

1) Load the Sheboygan package from http://download.osgeo.org/mapguide/releases/2.0.0/samples/Sheboygan.mgp

2) Open the LimeGold or TurquoiseYellow layout

3) Click on the legend tab

4) Right click on one of the layers to bring up the context menu

5) Right click on another layer to bring up the context menu

A "Stack overlow at line: 0" error dialog will come up.

It will also come up if you:

1) Bring up a context menu (in the legend or map)

2) Then (left) click anywhere on the "Tasks/Legend/Selection" pane

I believe that this is IE only.

Change History (4)

comment:1 by pagameba, 14 years ago

Owner: changed from madair to pagameba
Status: newassigned

comment:2 by pagameba, 14 years ago

state: Analysis RequestedAnalysing

ugh! is all I have to say to this one so far ... researching ...

comment:3 by pagameba, 14 years ago

The culprit is the eventInMenu method of menus, it has a recursive check to see if an event happened inside the menu before deciding if the mouse event should close the menu. The stack overflow seems to be triggered by a deeply nested call stack in IE, and recursion is often at fault.

I'm figuring out if we can refactor the code to remove the recursion.

comment:4 by pagameba, 14 years ago

Resolution: fixed
Status: assignedclosed

(In [1692]) Fixes #173. Remove recursive calls in eventInMenu, descendantOf and findElement to avoid stack overflow errors when closing menus from a mouse click in deeply nested HTML structures. This fix will be bundled in jxlib beta 5 which needs to be released in sync with changes to the mapguide templates (for fusion) so I have manually applied the fixes to this version of jxlib for now.

Note: See TracTickets for help on using tickets.