Closed Bug 727576 Opened 12 years ago Closed 12 years ago

FileReader slice should not have moz prefix

Categories

(Firefox :: Untriaged, defect)

13 Branch
x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 725289

People

(Reporter: desiradaniel2007, Unassigned)

Details

Attachments

(1 file)

Attached file 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
Closed: 12 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: