Closed Bug 300783 Opened 20 years ago Closed 20 years ago

Fix for bug 290354 introduced unsafe firing of events

Categories

(Core :: Disability Access APIs, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: aaronlev)

References

Details

Attachments

(1 file, 2 obsolete files)

The new events added in bug 290354 are being fired from within the guts of some code that really can't deal with DOM mutations. If someone happens to listen to those events and actually change the DOM from the event listeners, we'll crash. We should really be firing these events once we unwind to somewhere where it's safe to fire events (the outer event loop, basically).
Bz, can you point me some other code that does that so I can do it the right way? Also, it probably makes sense only to fire these events when the containing listbox has focus.
I don't believe we have such code... Most places we fire events it's safe to do it; we have crash bugs filed on the rest.
I'd like to fix everything that has been mentioned in one patch: 1) Remove "DOM" prefix from DOMItemSelected and DOMItemUnselected 2) Fix perf by only firing events for the focused element, and when aNotify is true 3) Fix leaks (not sure where they're from yet) 4) Fix unsafe firing Bz, do you recommend I use a PLEvent to fire the event and make it safe?
Yeah, if that works for accessibility, that would be great.
I'm not really that familiar with our event stuff.... that looks like it should generally work. But it's still firing synchronously and unsafely; I don't see any PLEvents around.
Blocks: deera11y
I haven't looked into the balsa leaks reported in bug 300833 yet. This should fix the perf regression reported in bug 290354.
Attachment #189505 - Attachment is obsolete: true
Attachment #190321 - Flags: superreview?(bzbarsky)
Attachment #190321 - Flags: review?(bzbarsky)
Actually the perf regression was bug 300818.
So I've been thinking about this... accessibility is already an nsIDocumentObserver, right? Is there a reason that ContentStatesChanged() can't be used here? Doesn't it happen exactly when we'd want it to?
Attachment #190321 - Flags: superreview?(bzbarsky)
Attachment #190321 - Flags: review?(bzbarsky)
Comment on attachment 190373 [details] [diff] [review] Use ContentStatesChanged(). This means we can get rid of the changes from bug 290354 in nsHTMLOptionElement. We still need the nsListControlFrame changes for when DOMMenuItemActive is fired. >Index: accessible/src/html/nsHTMLSelectAccessible.cpp >+ accService->GetAccessibleFor(optionNode, getter_AddRefs(optionAccessible)); >+ if (!optionNode) { I assume that should be a check of optionAccessible? r+sr=bzbarsky with that
Attachment #190373 - Flags: superreview?(bzbarsky)
Attachment #190373 - Flags: superreview+
Attachment #190373 - Flags: review?(bzbarsky)
Attachment #190373 - Flags: review+
Attachment #190373 - Flags: approval1.8b4?
Comment on attachment 190373 [details] [diff] [review] Use ContentStatesChanged(). This means we can get rid of the changes from bug 290354 in nsHTMLOptionElement. We still need the nsListControlFrame changes for when DOMMenuItemActive is fired. a=mkaply - don't forget bz's change
Attachment #190373 - Flags: approval1.8b4? → approval1.8b4+
Bz's change is in Checking in accessible/src/base/nsDocAccessible.cpp; /cvsroot/mozilla/accessible/src/base/nsDocAccessible.cpp,v <-- nsDocAccessible.cpp new revision: 1.70; previous revision: 1.69 done Checking in accessible/src/html/nsHTMLSelectAccessible.cpp; /cvsroot/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp,v <-- nsHTMLSelectAccessible.cpp new revision: 1.46; previous revision: 1.45 done Checking in accessible/src/html/nsHTMLSelectAccessible.h; /cvsroot/mozilla/accessible/src/html/nsHTMLSelectAccessible.h,v <-- nsHTMLSelectAccessible.h new revision: 1.28; previous revision: 1.27 done Checking in content/html/content/src/nsHTMLOptionElement.cpp; /cvsroot/mozilla/content/html/content/src/nsHTMLOptionElement.cpp,v <-- nsHTMLOptionElement.cpp new revision: 1.136; previous revision: 1.135 done
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Blocks: 300818
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: