mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 774987 - Remove a leak and unnecessary copy in touch event handling. r=smaug
This commit is contained in:
parent
b66d71f27e
commit
d48f4b5292
@ -5556,11 +5556,13 @@ EvictTouchPoint(nsCOMPtr<nsIDOMTouch>& aTouch)
|
|||||||
if (!frame) {
|
if (!frame) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
nsPoint *pt = new nsPoint(aTouch->mRefPoint.x, aTouch->mRefPoint.y);
|
nsPoint pt(aTouch->mRefPoint.x, aTouch->mRefPoint.y);
|
||||||
widget = frame->GetView()->GetNearestWidget(pt);
|
widget = frame->GetView()->GetNearestWidget(&pt);
|
||||||
|
|
||||||
if (!widget) {
|
if (!widget) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsTouchEvent event(true, NS_TOUCH_END, widget);
|
nsTouchEvent event(true, NS_TOUCH_END, widget);
|
||||||
event.widget = widget;
|
event.widget = widget;
|
||||||
event.time = PR_IntervalNow();
|
event.time = PR_IntervalNow();
|
||||||
@ -6500,9 +6502,8 @@ PresShell::DispatchTouchEvent(nsEvent *aEvent,
|
|||||||
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aEvent);
|
nsTouchEvent* touchEvent = static_cast<nsTouchEvent*>(aEvent);
|
||||||
// touch events should fire on all targets
|
// touch events should fire on all targets
|
||||||
if (aEvent->message != NS_TOUCH_START) {
|
if (aEvent->message != NS_TOUCH_START) {
|
||||||
nsTArray<nsCOMPtr<nsIDOMTouch> > touches = touchEvent->touches;
|
for (PRUint32 i = 0; i < touchEvent->touches.Length(); ++i) {
|
||||||
for (PRUint32 i = 0; i < touches.Length(); ++i) {
|
nsIDOMTouch *touch = touchEvent->touches[i];
|
||||||
nsIDOMTouch *touch = touches[i];
|
|
||||||
if (!touch || !touch->mChanged) {
|
if (!touch || !touch->mChanged) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -6550,9 +6551,8 @@ PresShell::DispatchTouchEvent(nsEvent *aEvent,
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// touchevents need to have the target attribute set on each touch
|
// touchevents need to have the target attribute set on each touch
|
||||||
nsTArray<nsCOMPtr<nsIDOMTouch> > touches = touchEvent->touches;
|
for (PRUint32 i = 0; i < touchEvent->touches.Length(); ++i) {
|
||||||
for (PRUint32 i = 0; i < touches.Length(); ++i) {
|
nsIDOMTouch *touch = touchEvent->touches[i];
|
||||||
nsIDOMTouch *touch = touches[i];
|
|
||||||
if (touch->mChanged) {
|
if (touch->mChanged) {
|
||||||
touch->SetTarget(mCurrentEventContent);
|
touch->SetTarget(mCurrentEventContent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user