DOM Files should DEFER_OPEN their streams

RESOLVED FIXED in mozilla6

Status

()

Core
DOM
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

(Depends on: 4 bugs)

Trunk
mozilla6
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [needs test after BlobBuilder lands])

Attachments

(1 attachment)

Comment hidden (empty)
Created attachment 531951 [details] [diff] [review]
Patch

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)

Comment 2

6 years ago
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?

Comment 4

6 years ago
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
Last Resolved: 6 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
Depends on: 711877
Depends on: 711880
Depends on: 711881
Depends on: 711883
Depends on: 711884
You need to log in before you can comment on or make changes to this bug.