Closed Bug 333544 Opened 19 years ago Closed 15 years ago

Infrastructure for safe event delivery

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

See this thread for context: http://groups.google.com/group/mozilla.dev.tech.dom/browse_frm/thread/0b12806d1cb33d4d/42cb0a2d38f95bd9#42cb0a2d38f95bd9 I think we need infrastructure to make it easy for Gecko to fire DOM events and ensure they're processed at reasonable times ... not too early while things are in inconsistent states, but not too late to slow things down or result in unpleasant reorderings.
Attached patch infrastructureSplinter Review
This patch has the new APIs. There's nsSafeForScript.h/.cpp which contains the machinery for globally blocking script execution. There's new nsIDocument APIs to block scripts from running in a frozen/script-disabled document (possibly later, modally disabled). There's new nsContentUtils::DispatchTrustedEventSafe methods to conveniently fire DOM events safely, and a new nsEventDispatcher::DispatchEventSafe to conveniently fire nsEvents safely.
This changes our code to fire onscroll events not off an event, but semi-synchronously before we Composite(), using the new APIs. I hope this addresses bug 316992 but it's hard to tell. It seems better, anyway.
Comments would be useful. I'll attach some patches to show how to fix more safety issues using the APIs, but initially I'm looking to check in just the infrastructure, for ease of review/regression catching.
QA Contact: ian → general
Safe script runners have taken care of this.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: