Closed Bug 350846 Opened 18 years ago Closed 18 years ago

Combine NS_***_LOAD events

Categories

(Core :: DOM: Events, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(2 files, 1 obsolete file)

I see no real reason to have 3 events for load.
Attached patch proposed patch (obsolete) — Splinter Review
I propose calling it just NS_LOAD.

(Removing all cases when multiple event types map to one event name helps with
the nsDOMEvent/nsEvent merge ... which I've been doing way too slowly.)
Attachment #236219 - Flags: superreview?(jst)
Attachment #236219 - Flags: review?(jst)
Attached patch proposed patch.Splinter Review
Oops, the first patch was for some other bug.
Attachment #236219 - Attachment is obsolete: true
Attachment #236220 - Flags: superreview?(jst)
Attachment #236220 - Flags: review?(jst)
Attachment #236219 - Flags: superreview?(jst)
Attachment #236219 - Flags: review?(jst)
Comment on attachment 236220 [details] [diff] [review]
proposed patch.

r+sr=jst, but I realized one thing as I was reviewing...

- In nsGlobalWindow::PostHandleEvent():

   } else if (aVisitor.mEvent->message == NS_PAGE_UNLOAD) {
     // Execute bindingdetached handlers before we tear ourselves
     // down.
     if (mDocument) {
       NS_ASSERTION(mDoc, "Must have doc");
       mDoc->BindingManager()->ExecuteDetachedHandlers();
     }
     mIsDocumentLoaded = PR_FALSE;
-  } else if (aVisitor.mEvent->message == NS_PAGE_LOAD) {
+  } else if (aVisitor.mEvent->message == NS_LOAD) {
+    // This is page load event since load events don't propagate to |window|.
+    // @see nsDocument::PreHandleEvent.
     mIsDocumentLoaded = PR_TRUE;

Both of these cases should also check if the event is trusted before setting the internal mIsDocumentLoaded state based on (un)load events. Unrelated to this patch, maybe, but I realized this as I was reviewing.
Attachment #236220 - Flags: superreview?(jst)
Attachment #236220 - Flags: superreview+
Attachment #236220 - Flags: review?(jst)
Attachment #236220 - Flags: review+
I'll check in this.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
*** Bug 191961 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: