Closed Bug 108761 Opened 24 years ago Closed 24 years ago

Need ability to control command updating for cmd_undo, cmd_redo and cmd_delete

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.7

People

(Reporter: mscott, Assigned: mscott)

References

Details

(Keywords: perf)

Attachments

(1 file)

A while ago, we all made some nice performance improvements with regards to command updating by re-organizing command updating and the events we try to update commands for. This made a huge difference in various parts of the product including mailnews compose and the mail 3-pane. I'm noticing that there are 3 commands in the mail3-pane which aren't under our control when it comes to updating: cmd_undo cmd_redo cmd_delete That's because these items come from utitlityOverlay.xul and that code doesn't have the application defined smarts for when to perform updating or not. Focus events trigger these things to get updated. Where is this an issue? Well I'm noticing during message display that we update these 3 commands twice before we load the message and twice after we load the message. Why? Because in loading a message we are creating a new content viewer in the message pane docshell. Creation of a new content viewer is triggering some suppress focus code: SetSuppressFocus in docshell. We then simulate a change in focus when the content is done loading. This is causing the command updating to happen. I'm wondering if it's possible for me to somehow give my app instance control over when these 3 commands are updated like the rest of the commands defined in mailnews. Then we can decouple them from focus changes like the rest of the mailnews commands. Obviously it's tricky because these commands are brought in from utilityOverlay.xul and we want to continue bringing in utilityOverlay.xul. Is there a way to do this?
re-wording the summary so it sounds like proper english.
Blocks: 22960
Status: NEW → ASSIGNED
Keywords: nsbeta1, perf
Summary: Need ability to have undo, redo and cmd_delete not updated on focus events → Need ability to control command updating for cmd_undo, cmd_redo and cmd_delete
Target Milestone: --- → mozilla0.9.7
Here's the spot in utilityOverlay.xul where we set the events we want to update these commands on. In some sense I want the ability to "override" the events for these command sets. <commandset id="globalEditMenuItems" commandupdater="true" events="focus" oncommandupdate="goUpdateGlobalEditMenuItems()"/> <commandset id="selectEditMenuItems" commandupdater="true" events="select" oncommandupdate="goUpdateSelectEditMenuItems()"/>
Keywords: nsbeta1nsbeta1+
Oh goody, my trial and error I discovered that I can redefine these command sets in a separate overlay which gets brought in after utilityOverlay.xul. I can specify one of our custom events in this overlay and instead of re-acting on focus and on select, we only update these commands when we fire our custom events. An alternative solution I was exploring was using removelement="true" and manually removing the command sets from the mail 3-pane. This however requires a fix for Bug #109200. And after Chris and I figured that out, I realized I didn't really care about removing the command sets anyway. Just having the ability to modify the event that triggers the command was plenty for me. I verified that the code in nsXULCommandDispatcher properly replaces the existing event with my event when it merges the 2 together. Patch coming.
This patch now stops us from updating cmd_redo, cmd_undo and cmd_delete when displaying a message (we were doing each one twice before). Those were the last 3 commands still getting updated every time we display a message. We'll also want to adopt this fix for the mail compose window as well. I'll file a spin off bug. I'm going to move this bug back into the mail component since it didn't require an XP-Apps change. Please note: utilityOverlay.xul still has a lot of stuff in it that most of the consumers aren't really using. It will still be desireable to break it down into smaller overlays. Joe Hewitt said that's on his plate of performance items to look at. My little patch just fixes part of the problem for me =).
Component: XP Apps → Mail Window Front End
Product: Browser → MailNews
Comment on attachment 57163 [details] [diff] [review] over ride the default events for command updating for some command sets I got an sr=sspitzer for this.
Attachment #57163 - Flags: superreview+
Attachment #57163 - Flags: review+
fix checked in. And child bug spun off to make this same optimization in messenger compose.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
QA Contact: sairuh → stephend
This was one of those "only a developer could _truly_ verify this bug" deals, am I right? :-)
I tested the 27th build on my own time and found that we're 5.11 seconds to read 5 10KB messages in a local folder the 1st time, then 5.07 and 5.04 seconds each consecutive time. This brings us to 4.x parity! :-) Verified FIXED.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: