Open Bug 906897 Opened 11 years ago Updated 2 years ago

Calling abort() on an inactive FileReader throws an exception

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
All
defect

Tracking

()

People

(Reporter: arun, Unassigned)

Details

Attachments

(1 file)

Current Behavior: var f = new FileReader(); f.abort(); will throw an exception, owing to bug 657964. Expected Behavior: The File API says: http://dev.w3.org/2006/webapi/FileAPI/#abort which is to do nothing about an abort() call when the status is EMPTY or DONE, NOT to throw an exception. Other Browsers: Chrome and Safari do not throw an exception.
Flags: needinfo?(khuey)
Is this a regression?
Somewhat: we purposefully changed to a behavior that does not match the spec.
bz, I think that this behavior was introduced because the spec. itself was in flux. I don't think it was a willful violation of spec. If you think spec. behavior is wrong, I'd like to know of course :)
I vaguely recall that we intended to align with XHR or something here. Maybe that never ended up happening.
Flags: needinfo?(khuey)
XMLHttpRequest's abort() never throws. I think generally we should throwing unless it catches something that's an actual mistake or cannot be readily handled. I don't think that's the case here.
Attachment #826457 - Flags: review?(bugs)
Hey guys, Should I also remove [Throws] just before void abort(); in FileReader.webid? Thanks
Comment on attachment 826457 [details] [diff] [review] FileReaderException.diff Yes, you should remove [Throws] and the ErrorResult param since per spec the method doesn't throw.
Attachment #826457 - Flags: review?(bugs)
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: