Open Bug 136301 Opened 23 years ago Updated 2 years ago

mousing over menus causes reflow

Categories

(Core :: XUL, defect)

defect

Tracking

()

People

(Reporter: dbaron, Unassigned)

Details

(Keywords: perf, Whiteboard: [patch])

Attachments

(1 file)

While profiling bug 5693, I discovered that mousing over menus causes a reflow. I first found the style rule that was guilty, and fixed it, and it's *still* causing a reflow. So then I discovered that nsBoxFrame::AttributeChanged unconditionally does a MarkDirty (at the end of the function). In this case the attribute is _moz_menuactive. So this means that any time an attribute changes on a XUL element, we reflow. At least that's what it seems like to me, and looks like in my profile. I'll attach the modern skin CSS patch, but it seems (based on my profile) like menu mouseover performance could be about 50% better if we didn't reflow. (And this is with the patch for bug 5693.) FWIW, I was testing by moving the mouse pointer up and down over my bookmarks menu.
This unconditional MarkDirty was added in: revision 1.171 date: 2001/12/03 23:41:08; author: evaughan%netscape.com; state: Exp; lines: +48 -15 Facelift for nsBoxToBlockAdaptor -r hyatt -sr waterson #110328 Grid memory leak -r naving -sr hewitt #109490 jag moved it accidentially while checking in bug 959, and then moved it back soon thereafter to fix assertions at startup.
See also bug 113528, a similar problem, it seems.
Comment on attachment 78294 [details] [diff] [review] CSS patch (modern) to prevent style system from generating any reflows r=bryner
Attachment #78294 - Flags: review+
I think that patch wasn't the main problem anyway -- I think that's just the buttons at the end of the menus. Then again, the fact that they resize on :hover is annoying...
Keywords: patch
OS: Linux → All
Hardware: PC → All
Keywords: mozilla1.1
I see this at http://home.olemiss.edu/~jhknight/ (links on left) in 2002071004. Is it the same bug?
No, this is a bug about *menus*, not some HTML simulation thereof.
Assignee: hyatt → dbaron
Whiteboard: [patch]
Do we still reflow?
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
dbaron, was this FIXED by the Reflow Branch by chance?
From glancing at the nsBoxFrame::AttributeChanged, it appears to be much more careful now about triggering FrameNeedsReflow(), so this is probably fixed/irrelevant
Assignee: dbaron → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: