Closed Bug 254894 Opened 20 years ago Closed 19 years ago

Menu automatically closes when using xmlhttprequest in an interval timer

Categories

(Core :: Widget: Win32, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: martijn.martijn, Assigned: neil)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a3) Gecko/20040808 Firefox/0.9.1+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a3) Gecko/20040808 Firefox/0.9.1+

See upcoming testcase. I'm not sure in which component this bug should be.

This testcase causes the menu to close again (after 2 seconds which is the timer
interval of the script), after you have opened it.
It happens because of:
var req = new XMLHttpRequest();
req.open("GET", this.location.href,false);
req.send(null);


Reproducible: Always
Steps to Reproduce:
1. Load testcase
2. Open any menu with the mouse. 
3. Stay on the same position of where you clicked to open the menu

Actual Results:  
Menu closes automatically (max 2 seconds after clicking).

Expected Results:  
Should not close menu automatically.
Attached file testcase (obsolete) —
Attached file This one works
Aargh! the previous one was wrong. This one should show the bug.
Attachment #155583 - Attachment is obsolete: true
Probably related to all the
document-refresh-stealing-keyboard-focus-from-textbox issues.
Blocks: 140346
Component: Browser-General → Event Handling
Blocks: 293741
Could pushing a new event queue somehow close the menu?
This is a windows-only bug, according to my stack trace. Investigating...
(In reply to comment #4)
> Could pushing a new event queue somehow close the menu?
It sure could. In Windows, creating an event queue creates a window, but the
widget code dismisses all popups whenever a window is moved, sized or created.
So maybe we should only make the dismissal code work for visible windows?
Over to Windows widget...  We should do _something_, certainly; having event
queue pushing closing popups is no good.
Assignee: general → win32
Component: Event Handling → Widget: Win32
QA Contact: general → ian
(In reply to comment #7)
> So maybe we should only make the dismissal code work for visible windows?

That seems logical to me.
*** Bug 293741 has been marked as a duplicate of this bug. ***
Attached patch Proposed patchSplinter Review
Assignee: win32 → neil.parkwaycc.co.uk
Status: NEW → ASSIGNED
Attachment #186874 - Flags: review?(dean_tessman)
Comment on attachment 186874 [details] [diff] [review]
Proposed patch

Assuming it works, r=me.  Alternatively, couldn't we kill a level of braces by
changing this to:

if (!(gRollupListener && gRollupWidget && IsWindowVisible(inWnd)))
  return FALSE;

Or something similar?
Attachment #186874 - Flags: review?(dean_tessman) → review+
Attachment #186874 - Flags: superreview?(darin)
Comment on attachment 186874 [details] [diff] [review]
Proposed patch

rs=darin
Attachment #186874 - Flags: superreview?(darin) → superreview+
Comment on attachment 186874 [details] [diff] [review]
Proposed patch

Trivial fix.
Attachment #186874 - Flags: approval1.8b3?
Attachment #186874 - Flags: approval1.8b3? → approval1.8b3+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Blocks: 252412
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: