Closed Bug 643164 Opened 14 years ago Closed 14 years ago

Fire MozScrollAreaChanged before "load", not after

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: stechz, Assigned: stechz)

Details

Attachments

(1 file, 1 obsolete file)

Currently MozScrollAreaChanged is fired basically as an executeSoon. This causes the "pageshow" and "load" events to be fired before MozScrollAreaChanged. Fennec does scroll changes on the "load" event and keeps track of the size of the page using MozScrollAreaChanged, so we have to use ugly hacks. Guaranteeing that MozScrollAreaChanged always fires before the load event would make our code cleaner.
Timothy, do you mind reviewing this? This patch now does a check to see if it is safe to fire the event (in other words, if we are not in the middle of a reflow). When a page is loaded, pending reflows are flushed so I fire the event during the post-reflow callback instead of waiting for the new event. I left the old way of doing it and safely exit out if the event is already flushed. I'm not sure this is necessary.
Attachment #520463 - Flags: review?(tnikkel)
Assignee: nobody → ben
Comment on attachment 520463 [details] [diff] [review] Fire MozScrollAreaChanged before "load", not after I didn't even know this event existed, so I'm going to punt this to roc.
Attachment #520463 - Flags: review?(tnikkel) → review?(roc)
How about just using AddScriptRunner in PostScrolledAreaEvent?
Nice! Thanks for the idea.
Attachment #520552 - Flags: review?(roc)
Attachment #520463 - Attachment is obsolete: true
Attachment #520463 - Flags: review?(roc)
Try run was good.
Whiteboard: [needs landing]
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: