FileReader slice should not have moz prefix

RESOLVED DUPLICATE of bug 725289

Status

()

RESOLVED DUPLICATE of bug 725289
7 years ago
7 years ago

People

(Reporter: desiradaniel2007, Unassigned)

Tracking

13 Branch
x86
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 597530 [details]
editor.html

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:13.0a1) Gecko/20120209 Firefox/13.0a1
Build ID: 20120209031242

Steps to reproduce:

I tried removing a block of Gecko/Web-kit-specific code from a function:
Original:
		function readFile(evt) {
			var reader = new FileReader();
			var file = evt.target.files[0];
			var blob;
			if (file.mozSlice) {
				blob = file.mozSlice(0, file.size - 1);
			} else if (file.webkitSlice) {
				blob = file.webkitSlice(0, file.size - 1);
			} else if (file.slice) {
				blob = file.slice(0, file.size - 1);
			}
			reader.readAsText(blob);
			reader.onload = function() {
				document.getElementById('edit').value = "";
				document.getElementById('edit').value = reader.result;
			}
			parse();
		}
Edited:
		function readFile(evt) {
			var reader = new FileReader();
			var file = evt.target.files[0];
			var blob;
			/*if (file.mozSlice) {
				blob = file.mozSlice(0, file.size - 1);
			} else if (file.webkitSlice) {
				blob = file.webkitSlice(0, file.size - 1);
			} else if (file.slice) {*/
				blob = file.slice(0, file.size - 1);
			//}
			reader.readAsText(blob);
			reader.onload = function() {
				document.getElementById('edit').value = "";
				document.getElementById('edit').value = reader.result;
			}
			parse();
		}


Actual results:

No text file could be read on neither Firefox nor Chrome. It actually worked in Opera 12.


Expected results:

Firefox should follow Opera since the FileReader API seems to be settled.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 725289
You need to log in before you can comment on or make changes to this bug.