Closed Bug 371902 Opened 17 years ago Closed 17 years ago

optimize and clean up child view event handling code

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Assigned: jaas)

Details

Attachments

(2 files)

17.61 KB, patch
stuart.morgan+bugzilla
: review+
mikepinkerton
: superreview+
Details | Diff | Splinter Review
5.93 KB, patch
stuart.morgan+bugzilla
: review+
pavlov
: superreview+
Details | Diff | Splinter Review
There are a few simple things we can do to optimize and clean up child view event handling code.
Attached patch fix v1.0Splinter Review
1. All key events have 0,0 for a refpoint so just handle that in the key event conversion function instead of making callers do it every time they convert a key event.

2. Right now we ignore the message argument when creating gecko events, then we pass the message all the way through the conversion chain just to set it on the gecko event at the end. This is silly, just set the message when the event is created and stop passing it through the conversion chain as an unnecessary argument. Optimized signatures and simpler code. Win win.
Attachment #256596 - Flags: review?(stuart.morgan)
Comment on attachment 256596 [details] [diff] [review]
fix v1.0

Makes sense to me.

One other thing that would be nice to clean up:
convertLocation:... is a really inaccurate name; ideally it should just be folded into convertEvent:toGeckoEvent: but that messes up the drag stuff. Maybe split it into a few methods with accurate names, have convertEvent:... call all of them, and have the drag code call just the ones it needs?
Attachment #256596 - Flags: review?(stuart.morgan) → review+
Attachment #256596 - Flags: superreview?(mikepinkerton)
Comment on attachment 256596 [details] [diff] [review]
fix v1.0

sr=pink
Attachment #256596 - Flags: superreview?(mikepinkerton) → superreview+
landed on trunk, probably coming up with another patch so not marking as fixed
Get rid of convertLocation... The name didn't make much sense, the code was messy, and it was inefficient.
Attachment #256650 - Flags: review?(stuart.morgan)
Comment on attachment 256650 [details] [diff] [review]
convertLocation cleanup, v1.0

r=me
Attachment #256650 - Flags: review?(stuart.morgan) → review+
Attachment #256650 - Flags: superreview?(mikepinkerton)
Attachment #256650 - Flags: superreview?(mikepinkerton) → superreview?(pavlov)
Attachment #256650 - Flags: superreview?(pavlov) → superreview+
convertLocation fix landed on trunk
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: