Closed Bug 201983 Opened 23 years ago Closed 17 years ago

nsImageFrame::TranslateEventCoords assumes aResult is initialized

Categories

(Core :: Layout, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dbradley, Unassigned)

References

Details

(Whiteboard: [good first bug])

When it's called from nsImageFrame::GetContextForEvent and other places, the point passed in isn't initialized. nsBoxFrame seems to suffer the same problem. The default constructor of nsPoint doesn't initialize it's members.
Slight correction, it's aPoint, not aResult that isn't initialized.
->Misc Code
Assignee: other → misc
Component: Layout → Layout: Misc Code
QA Contact: ian → nobody
See also bug 10606
Depends on: 10606
Whiteboard: [good first bug]
It's hard to say, since I don't have a lot of history to go on here. But it's possible that the original author(s) may have done this on purpose for nsPoint. In the case of events, I'm not sure the point member is always valid. Thus default initializing it to zero for events that don't have coordinates is a small waste of time. I have no idea if the time involved to initialize it would impact anything noticeably. I could imagine that constructing an array of points in other places, it might be noticeable.
This seems to be wfm now: all callers pass in a reasonable aPoint.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Product: Core → Core Graveyard
Component: Layout: Misc Code → Layout
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.