Closed Bug 201300 Opened 22 years ago Closed 22 years ago

Fix dispatching of AttributeChanges to nsGfxScrollFrame

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(1 file, 1 obsolete file)

Currently every nsGfxScrollFrame registers a document listener so that it can see changes to the 'curpos' attribute on both of its scrollbars. This is way overkill and could be hurting performance a lot in some cases.
My approach to fixing this is to have nsScrollbarFrame forward its frame attribute change notification to its nsGfxScrollFrame parent (if there is one), if the attribute is 'curpos'. This eliminates the need for nsGfxScrollFrame to observe the document. It reduces the number of attribute change notifications to nsGfxScrollFrame to *zero* for a sequence of normal (non-scrolling) page loads. Patch coming up.
Comment on attachment 119937 [details] [diff] [review] fix wrong patch, sorry
Attachment #119937 - Attachment is obsolete: true
Attachment #119938 - Flags: superreview?(bzbarsky)
Attachment #119938 - Flags: review?(bzbarsky)
Comment on attachment 119938 [details] [diff] [review] fix >+ // This gets called when the 'curpos' attribute on one of the scrollbars changes >+ nsresult CurPosAttributeChanged(nsIPresContext* aPresContext, Might be nice to make this protected and make nsGfxScrollFrame a friend class.... >+ parent->QueryInterface(NS_GET_IID(nsIScrollableFrame), (void**)&scrollable); rv = CallQueryInterface(parent, &scrollable); r/sr=me with those.
Attachment #119938 - Flags: superreview?(bzbarsky)
Attachment #119938 - Flags: superreview+
Attachment #119938 - Flags: review?(bzbarsky)
Attachment #119938 - Flags: review+
> Might be nice to make this protected and make nsGfxScrollFrame a friend > class.... nsGfxScrollFrameInner is only visible in nsGfxScrollFrame.cpp, so this doesn't seem necessary. (Hence "Inner") > rv = CallQueryInterface(parent, &scrollable); Oh yeah. willdo
Checked in. This should be interesting.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Hmm. Tp may have gone down by some "in the noise" amount, but that's all. Well at least we know the Tp slowdown from smooth scrolling was not due to AttributeChanged callbacks.
Has this anything to do with bug 201435?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: