Closed Bug 681718 Opened 8 years ago Closed 8 years ago

JS errors from text selection when long-tapping on local pages

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 9

People

(Reporter: mbrubeck, Assigned: mbrubeck)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
When I tap and hold on an about:page, I get JavaScript errors like this, and sometimes context menus fail to appear (for example, long-press on a "tabs from last time" row with the patch from bug 680933 applied does not always bring up a context menu like it should):

JavaScript error: chrome://browser/content/content.js, line 1378: this.getCurrentWindowAndOffset(x, y, scrollOffset) is undefined

This patch fixes the errors I am seeing.
Attachment #555473 - Flags: review?(mark.finkle)
Comment on attachment 555473 [details] [diff] [review]
patch


>       case "Browser:SelectionMeasure": {
>+        if (!this.contentWindow)
>+          return;
>         let selection = this.contentWindow.getSelection();
>         let range = selection.getRangeAt(0).QueryInterface(Ci.nsIDOMNSRange);

Add a blank line after the "return"
Attachment #555473 - Flags: review?(mark.finkle) → review+
(In reply to Mark Finkle (:mfinkle) from comment #1)
> Add a blank line after the "return"

Done, and pushed to inbound:

https://hg.mozilla.org/integration/mozilla-inbound/rev/7254c4f4a805
Assignee: nobody → mbrubeck
Status: NEW → ASSIGNED
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/7254c4f4a805
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → Firefox 9
Verified fixed on build:Mozilla /5.0 (Android;Linux armv7l;rv:9.0a1) Gecko/20110830 Firefox/9.0a1 Fennec/9.0a1
Device: LG Optimus 2X (Android 2.3)

Long tap on "tabs from last time" brings up the context menu and no error in the console.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.