Closed Bug 49175 Opened 25 years ago Closed 23 years ago

View event processing needs to be made fast, robust and moved into the view manager

Categories

(Core :: Web Painting, defect, P3)

x86
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 96832
mozilla1.0.1

People

(Reporter: alla, Assigned: roc)

References

Details

(Keywords: perf)

Attachments

(3 files)

While profiling to fix bug 39573 i found some slow code in nsView::HandleEvent(). It basically looped numChildren times calling GetChild(i), and each GetChild looped i times to find the child. I've written a patch that fixes this and two more like it. I'll attach it. It was a major helper in getting performance up on bug 39573.
Blocks: 39573
The paint patch should be unnecessary. As far as I know, nsViewManager2 always uses NS_VIEW_FLAG_JUST_PAINT, so in fact all the code in nsView relating to painting of child views is dead code. I've actually removed that code from my tree and put in an assertion in case it would ever be used, and everything works just fine... This code should just be removed. The other loop changes look good. If Kevin doesn't want this bug, he can assign it to me, and if I get review and approval I can check the code in.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Robert is correct, nsViewManager2 always passes NS_VIEW_FLAG_JUST_PAINT. The other logic which walks the view tree pre-dates the use of a display list. Its been left around simply for debugging. Added perf keyword. The other part of the patch looks good.
Status: NEW → ASSIGNED
Keywords: perf
Adding patch keyword. Can we get rid of the unused painting code? It confuses the reader, and at this point it's basically just wrong.
Keywords: patch
Sure. I no longer use it for debugging purposes.
Re-assigning to Robert.
Assignee: kmcclusk → roc+moz
Status: ASSIGNED → NEW
There are more of these, in nsScrollPortView.cpp and nsScrollingView.cpp. I'm attaching patches for these too.
OK, can I have review and approval for patch 13142 please?
Status: NEW → ASSIGNED
Hoping kmcclusk can give an r=, or find someone who will. /be
I reviewed the changes and they look good. r=kmcclusk@netscape.com
Fix checked in. Thanks Alex, Brendan, Kevin!
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
alex mentions in bug 39753 that this bug's fix has been reverted. If that's the case shouldn't this bug be reopened?
That should be bug 39573.
Reopening. To truly fix this bug is actually quite difficult, and probably won't happen soon. My summary from bug 50335 discussion: View event handling must be able to deal with the deletion of any arbitrary view during each event handler call. The best way to achieve this seems to be to move the event handling logic out of nsView::HandleEvent and up into nsViewManager. I have a patch in my tree that does this and stops the crashes but does not resolve all the problems, namely: -- Some event processing can be dropped if a view is destroyed during event handling, even if the content is still around and would normally receive the event (could cause VERY RARE bugs) -- Event processing needs to be reworked to handle Z-order properly, using a display-list-like mechanism. A general "event handling in views" rewrite is needed. I will produce one, but maybe not soon :-).
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Summary: There are some O(n^2) algorithms in nsView.cpp → View event processing needs to be made fast, robust and moved into the view manager
Status: REOPENED → ASSIGNED
Target Milestone: --- → mozilla1.0
Bugs targeted at mozilla1.0 without the mozilla1.0 keyword moved to mozilla1.0.1 (you can query for this string to delete spam or retrieve the list of bugs I've moved)
Target Milestone: mozilla1.0 → mozilla1.0.1
*** This bug has been marked as a duplicate of 96832 ***
Status: ASSIGNED → RESOLVED
Closed: 25 years ago23 years ago
Resolution: --- → DUPLICATE
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: