Closed Bug 656640 Opened 13 years ago Closed 13 years ago

DOM Files should DEFER_OPEN their streams

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: khuey, Assigned: khuey)

References

(Depends on 4 open bugs)

Details

(Whiteboard: [needs test after BlobBuilder lands])

Attachments

(1 file)

      No description provided.
Attached patch PatchSplinter Review
This doesn't actually fix the TODO in the FileReader tests, because you can't construct a Blob for a non-existent file anyways ...

Still think we should take this though.
Assignee: nobody → khuey
Status: NEW → ASSIGNED
Attachment #531951 - Flags: review?(jonas)
Doesn't that mean that the DOMFile might get a totally different file from when it was created?

Do we have any plans to do what WebKit does here and have the DOMFile go blank if the file is changed, say?
(In reply to comment #2)
> Doesn't that mean that the DOMFile might get a totally different file from
> when it was created?

Yes, but I think that can happen now ...

> Do we have any plans to do what WebKit does here and have the DOMFile go
> blank if the file is changed, say?

We could, if we could tell that the file has changed.  Do you know how WebKit does this?
Nope.
Jonas and I discussed making File object creation for <input type="file"> stat the file (so that we would have the size handy, among other things).  A size check might be good enough.
Comment on attachment 531951 [details] [diff] [review]
Patch

Though would be great to have tests as discussed.
Attachment #531951 - Flags: review?(jonas) → review+
http://hg.mozilla.org/mozilla-central/rev/9776a5b8ccd9

The test will be much easier to write after the test refactoring in the BlobBuilder patch is landed, so setting in-testsuite? here.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite?
OS: Windows 7 → All
Hardware: x86 → All
Resolution: --- → FIXED
Whiteboard: [needs test after BlobBuilder lands]
Target Milestone: --- → mozilla6
Version: unspecified → Trunk
<3 for less Sync I/O on the GUI thread
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: