зеркало из https://github.com/mozilla/gecko-dev.git
Bug 909889 - Add guards around drag property access in CrossSlide. r=mbrubeck
This commit is contained in:
Родитель
e63149fab0
Коммит
bee1d7f75a
|
@ -240,14 +240,20 @@ CrossSlideHandler.prototype = {
|
|||
*/
|
||||
_fireProgressEvent: function CrossSliding_fireEvent(aState, aEvent) {
|
||||
if (!this.drag)
|
||||
return;
|
||||
return;
|
||||
let event = this.node.ownerDocument.createEvent("Events");
|
||||
let crossAxis = this.drag.crossAxis;
|
||||
let crossAxisName = this.drag.crossAxis;
|
||||
event.initEvent("MozCrossSliding", true, true);
|
||||
event.crossSlidingState = aState;
|
||||
event.position = this.drag.position;
|
||||
event.direction = this.drag.crossAxis;
|
||||
event.delta = this.drag.position[crossAxis] - this.drag.origin[crossAxis];
|
||||
if ('position' in this.drag) {
|
||||
event.position = this.drag.position;
|
||||
if (crossAxisName) {
|
||||
event.direction = crossAxisName;
|
||||
if('origin' in this.drag) {
|
||||
event.delta = this.drag.position[crossAxisName] - this.drag.origin[crossAxisName];
|
||||
}
|
||||
}
|
||||
}
|
||||
aEvent.target.dispatchEvent(event);
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче