Closed
Bug 1085158
Opened 10 years ago
Closed 10 years ago
FilePicker.js: "File is not defined" after selecting file to upload
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(firefox33 unaffected, firefox34 unaffected, firefox35+ verified, firefox36+ verified, fennec35+)
VERIFIED
FIXED
Firefox 36
Tracking | Status | |
---|---|---|
firefox33 | --- | unaffected |
firefox34 | --- | unaffected |
firefox35 | + | verified |
firefox36 | + | verified |
fennec | 35+ | --- |
People
(Reporter: joejob357, Assigned: baku)
References
()
Details
(Keywords: reproducible)
Attachments
(1 file, 1 obsolete file)
1.37 KB,
patch
|
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Android; Tablet; rv:35.0) Gecko/35.0 Firefox/35.0
Build ID: 20141019004001
Steps to reproduce:
* Load: http://validator.w3.org/#validate_by_upload
* Click Browse
* Select file
This is using Aurora on CyanogenMod Nightly on the Nexus 10. It is reproducible on this and at least one other site with a file upload field.
Actual results:
* The file upload field continued to report "No file specified"
* Logcat displayed
W/GeckoConsole( 5002): [JavaScript Error: "ReferenceError: File is not defined" {file: "jar:jar:file:///data/app/org.mozilla.fennec_aurora-2.apk!/assets/omni.ja!/components/FilePicker.js" line: 146}]
W/GeckoConsole( 5002): [JavaScript Error: "NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS: [JavaScript Error: "File is not defined" {file: "jar:jar:file:///data/app/org.mozilla.fennec_aurora-2.apk!/assets/omni.ja!/components/FilePicker.js" line: 146}]'[JavaScript Error: "File is not defined" {file: "jar:jar:file:///data/app/org.mozilla.fennec_aurora-2.apk!/assets/omni.ja!/components/FilePicker.js" line: 146}]' when calling method: [nsIFilePicker::domfile]" {file: "jar:jar:file:///data/app/org.mozilla.fennec_aurora-2.apk!/assets/omni.ja!/components/FilePicker.js" line: 247}]
I have had a similar problem running the release version of Firefox on this platform, but zooming out the page then zooming back forced the field to update. This no longer works.
Expected results:
The firm field should have updated to reflect the chosen file.
Summary: FilePicker.is: "File is not defined" after selecting file to upload → FilePicker.js: "File is not defined" after selecting file to upload
To expand, this workflow succeeds on v33 on the same platform; I haven't tested on v34.
Comment 2•10 years ago
|
||
After performing your steps, firefox crashes: https://crash-stats.mozilla.com/report/index/c6329104-8e64-4496-8f4f-3943f2141020
Tested with:
Device: Samsung S5 (Android 4.4)
Build: Firefox for Android 36.0a1 (2014-10-19)
Comment 4•10 years ago
|
||
[Tracking Requested - why for this release]: File uploading is broken
Status: UNCONFIRMED → NEW
tracking-fennec: --- → ?
status-firefox35:
--- → affected
status-firefox36:
--- → affected
tracking-firefox35:
--- → ?
Ever confirmed: true
Updated•10 years ago
|
Keywords: regressionwindow-wanted
Updated•10 years ago
|
status-firefox33:
--- → unaffected
Comment 5•10 years ago
|
||
I crash too. I'm using http://encodable.com/uploaddemo/ as a more appropriate uploader for example here. Looking for a range now.
Comment 6•10 years ago
|
||
The "File" constructor was removed from JSComponents here (bug 1047483):
https://hg.mozilla.org/releases/mozilla-aurora/rev/53a14a912960
I'm assuming its old and deprecated and we should never have used it or something. Was intentional? bz?
Updated•10 years ago
|
Flags: needinfo?(bzbarsky)
Comment 7•10 years ago
|
||
Last good revision: dd7637cc42d5 (2014-10-08)
First bad revision: f0bb13ef0ee4 (2014-10-09)
Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=dd7637cc42d5&tochange=f0bb13ef0ee4
Keywords: regressionwindow-wanted → reproducible
![]() |
||
Comment 8•10 years ago
|
||
We had a shim File constructor, looks like. I'm not quite sure why exactly it got removed. Bobby, should DOM File be exposed in JSMs by default?
In any case, for now you should be able to do |Cu.importGlobalProperties(['File'])| to import the 'File' constructor. That _should_ have happened in bug 1047483 but perhaps the fact that this file is named .js, not .jsm, confused things?
Assignee | ||
Comment 9•10 years ago
|
||
> In any case, for now you should be able to do
> |Cu.importGlobalProperties(['File'])| to import the 'File' constructor.
> That _should_ have happened in bug 1047483 but perhaps the fact that this
> file is named .js, not .jsm, confused things?
Actually, this File() is exposed to content so probably we should do:
return new this._domWin.File(file);
instead: return File(file);
But it seems that this._domWin can be null (can it really be?)
I'll propose a patch for this.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → amarchesini
Assignee | ||
Comment 10•10 years ago
|
||
Attachment #8508126 -
Flags: review?(bzbarsky)
![]() |
||
Comment 11•10 years ago
|
||
Comment on attachment 8508126 [details] [diff] [review]
file.patch
r=me
Attachment #8508126 -
Flags: review?(bzbarsky) → review+
Updated•10 years ago
|
status-firefox34:
--- → unaffected
Assignee | ||
Comment 12•10 years ago
|
||
Attachment #8508126 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 13•10 years ago
|
||
Hi, do you have a try link for this change? thanks!
Keywords: checkin-needed
Comment 14•10 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #8)
> We had a shim File constructor, looks like. I'm not quite sure why exactly
> it got removed. Bobby, should DOM File be exposed in JSMs by default?
Not AFAIK, at least until we add Exposed=System.
Flags: needinfo?(bobbyholley)
Assignee | ||
Comment 15•10 years ago
|
||
Assignee | ||
Comment 16•10 years ago
|
||
![]() |
||
Comment 17•10 years ago
|
||
> Not AFAIK, at least until we add Exposed=System.
The question is whether this interface should have Exposed=System, I guess.
Comment 18•10 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #17)
> > Not AFAIK, at least until we add Exposed=System.
>
> The question is whether this interface should have Exposed=System, I guess.
Fine by me, as long as we write tests.
Comment 19•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
Updated•10 years ago
|
Assignee | ||
Comment 21•10 years ago
|
||
Comment on attachment 8508280 [details] [diff] [review]
file.patch
Approval Request Comment
[Feature/regressing bug #]: 1047483
[User impact if declined]: android filepicker is broken
[Describe test coverage new/current, TBPL]: none. it seems that filepicker doesn't have tests in general.
[Risks and why]: the patch is very simple and it has been already verified.
[String/UUID change made/needed]: none
Attachment #8508280 -
Flags: approval-mozilla-aurora?
Updated•10 years ago
|
Attachment #8508280 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 22•10 years ago
|
||
Comment 23•10 years ago
|
||
Firefox crashes after performing steps from comment 0: https://crash-stats.mozilla.com/report/index/e1fe4531-3d49-4290-b330-48f312141202
Tested with:
Firefox for Android 35 Beta 1
Firefox for Android 36.0a2 (2014-12-01)
Firefox for Android 37.0a1 (2014-1-01) is also affected.
Device: Nexus 4 (Android 4.4.4). See Bug 1031429.
Comment 24•10 years ago
|
||
I also tested this with the following devices:
Motorla Razr (Android 4.1.2) and Asus Transformer Pad TF300T (Android 4.2.1)
On Firefox for Android 35 Beta 1
With URL: http://encodable.com/uploaddemo/ - after a file is selected, 'No files selected' text is changed to reflect the chosen file.
With URL from comment 0: http://validator.w3.org/#validate_by_upload - after a file is selected, 'No file selected' text is not updated to reflect the chosen file.
Firefox for Android 36.0a2 (2014-12-02) works as expected with both URLs. I will mark as verified only Firefox 36.
Comment 25•10 years ago
|
||
Verified as fixed on Firefox 35 Beta 4 on Samsung Galaxy Nexus (Android 4.2.1)
Status: RESOLVED → VERIFIED
Comment 26•6 years ago
|
||
Based on comment 24 and 25, I will remove the qe-verify flag, thanks.
Flags: qe-verify+
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•