Closed Bug 909889 Opened 6 years ago Closed 6 years ago

Exception this.drag.position is undefined

Categories

(Firefox for Metro Graveyard :: Firefox Start, defect)

x86_64
Windows 8
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: sfoster, Assigned: sfoster)

Details

Attachments

(1 file)

Seeing a lot of this in the console: 

* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "'[JavaScript Error: "this.drag.position is undefined" {file: "resource:///modules/CrossSlide.jsm" line: 254}]' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0"  data: yes]

I dont have reliable STR at this point.
Calls to CrossSlide's _fireProgressEvent include cancelled events; we can't assume a drag has all the expected properties. This patch just adds guards around this.drag property access in _fireProgressEvent
Assignee: nobody → sfoster
Attachment #801879 - Flags: review?(mbrubeck)
pt estimate=1
Comment on attachment 801879 [details] [diff] [review]
Add guards for undefined drag properties to CrossSlide

Review of attachment 801879 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/metro/modules/CrossSlide.jsm
@@ +250,5 @@
> +      if('origin' in this.drag)
> +        event.delta = this.drag.position[crossAxis] - this.drag.origin[crossAxis];
> +    }
> +    if ('crossAxis' in this.drag)
> +      event.direction = this.drag.crossAxis;

Nit: You can use the "crossAxis" instead of "this.drag.crossAxis" here.  Also, if it's possible for crossAxis to be undefined then we probably need to check that earlier, since it gets used above this point.
Attachment #801879 - Flags: review?(mbrubeck) → review+
https://hg.mozilla.org/mozilla-central/rev/87f7da1e9663
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 26
You need to log in before you can comment on or make changes to this bug.