-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does the specification define input[type=file] .files expected behaviour to relevant to reflecting real-time changes to user selected file? #99
Comments
plnkr to demonstrate the behaviour. Have not tried the code at MacOS or Windows. |
Is the behaviour of Chromium a bug? |
I consider the chromium behavior a bug, yes. File/Blob objects are supposed to be immutable (the whole snapshot state concept in the spec), although it isn't specified very well. I've been trying to fix the chromium behavior, but there's a lot of technical debt in that area so I haven't made much progress yet (but some semi-related refactorings we've been doing will make it easier to fix this properly). I'm also planning on cleaning up this part of the spec to make it more obvious what the expected behavior is. |
(https://crbug.com/818327 and https://crbug.com/710190 are the bugs tracking this issue) |
Filed https://bugs.chromium.org/p/chromium/issues/detail?id=844874 before notification of above links which state
when visited. |
Yeah, the other two bugs are marked as security issue since arguably being able to read file changes could be considered a security issue... |
Is this different from #75? |
@annevk #75 appears to be a general concern about mutating state of Blob/File objects. Further, this issue does not go as far as it could by testing shell code that mutates the the contents of the file on disk (where applicable https://stackoverflow.com/a/56419176). A barage of tests would probably be necessary to verify if the conceivable ways (e.g., following read Am not sure if this is a duplicate. This issue presents a concrete case with details where that mutation was/is possible. |
This redefines how blobs work by adding internal slots and hooks to support Blob objects backed by various sources of data. By doing so this tries to make more explicit how various edge cases behave, as well as making it clear that blobs are immutable. This fixes #75, fixes #99, and fixes #47. It also lays the ground work to address w3c/webappsec-clear-site-date#49. This also fixes #71.
This redefines how blobs work by adding internal slots and hooks to support Blob objects backed by various sources of data. By doing so this tries to make more explicit how various edge cases behave, as well as making it clear that blobs are immutable. This fixes #75, fixes #99, and fixes #47. It also lays the ground work to address w3c/webappsec-clear-site-date#49. This also fixes #71.
Could this bug, ironically, be used in Native File System to fix WICG/file-system-access#157? |
Consider the HTML and JavaScript posted at this Stack Overflow question Input file size and content do not update on macOS
HTML
JavaScript
Reproduce steps as described by OP of the question
Using a sample file, for example, https://gist.github.com/guest271314/11edc4566ba94f204dd46e6ae26edaad#file-d134213ba9465cb74dfd36cde47bf102638c4a9f3aca357f79ee747dd5f49f1e0f0de , which contains the text
123
Behaviour
Chromium 65
Once the local file is selected by user action and the local file is changed at a text editor, for example, by typing
4
following the existing123
at the file (for example, the above linked gist) bothlastModified
andsize
properties are reflected as being changed client side, indicating changes to local file are being updated in real time though the user has not performed the affirmative action of re-selecting the file.Firefox Trunk (60)
Once the local file is selected by user action and the local file is changed at a text editor, for example, by typing
4
following the existing123
at the file (for example, the above linked gist) bothlastModified
andsize
properties are not reflected as being changed client side, indicating changes to local file are being not updated in real time where the user has not performed the affirmative action of re-selecting the file.What does the specification define as the expected behaviour of
size
andlastModified
properties of aFile
object within aFileList
object where changes to an underlying local file are made after user selection of a local file?The text was updated successfully, but these errors were encountered: