-
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
Remove the / -> : replacement from the File constructor #41
Comments
sgtm |
Looking at https://wpt.fyi/results/FileAPI/file/File-constructor.html?label=experimental&label=master&aligned it appears that "Neither Chrome nor Gecko seems to implement it." is perhaps no longer true? It seems that now Gecko is the odd one out and actually does implement what the current spec says... |
Gecko implemented this in https://bugzilla.mozilla.org/show_bug.cgi?id=1321534 (2016). The actual discussion thread is https://lists.w3.org/Archives/Public/public-webapps/2013JulSep/0379.html, where there was quite a bit of back and forth. FWIW, Servo implements it too with a reference to this issue. |
@bakulf mentions the Entries API as motivation, which seems like it would still be relevant? |
In the Entries API, a name cannot contain '/' (https://wicg.github.io/entries-api/#names-paths). That spec uses '/' as directory separator here: https://wicg.github.io/entries-api/#evaluate-a-path |
I see, it's unfortunate Firefox implemented this change without noticing that this open issue existed, but I guess ultimately that is on us spec editors for not clearly marking these things in the spec. I'm not sure what the Entries API has to do with this. The Entries API does not consume File objects, it produces them. And when it produces them it doesn't do so by invoking the File constructor. The logic here only effect File objects created by javascript it seems completely irrelevant what the Entries API does (well, not irrelevant, it is good to be consistent. But that has nothing to do with being compatible). (also I might be missing something/not finding the right message, but I don't see anything in that discussion thread specifically related to replacing '/' with ':'?) If we do actually want to disallow '/' in the Also, non-traditional file systems, like for example Google Drive, do allow '/' in file names. And it's not immediately obvious to me why we would need to stop them from creating File objects with those names. Different platforms/file systems have different limitations, but we're not limiting File objects to the strictest possible subset of filenames (8.3 filenames only anyone?) |
Replacing rather than throwing does seem bad and Entries API does indeed only produce File objects, it doesn't appear to consume them. Entries API does appear to define a model for files in https://wicg.github.io/entries-api/#names-paths onward and that does conflict with allowing various code points in the name, including Looking at this I think a reasonable outcome would be:
|
There's also the issue that HTML specifies that filenames for |
Change the test to follow the proposed change in w3c/FileAPI#41, now that all browsers agree to not replace /. Depends on D86981 Differential Revision: https://phabricator.services.mozilla.com/D87112 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1650607 gecko-commit: 365ae38a5bca68e4d8c8cf25b8f5230e306b0f09 gecko-integration-branch: autoland gecko-reviewers: baku
Basically a backout of https://hg.mozilla.org/mozilla-central/rev/1857e763332c. Pending spec change: w3c/FileAPI#41 Differential Revision: https://phabricator.services.mozilla.com/D86981
Change the test to follow the proposed change in w3c/FileAPI#41, now that all browsers agree to not replace /. Depends on D86981 Differential Revision: https://phabricator.services.mozilla.com/D87112
Change the test to follow the proposed change in w3c/FileAPI#41, now that all browsers agree to not replace /. Depends on D86981 Differential Revision: https://phabricator.services.mozilla.com/D87112 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1650607 gecko-commit: 365ae38a5bca68e4d8c8cf25b8f5230e306b0f09 gecko-integration-branch: autoland gecko-reviewers: baku
Basically a backout of https://hg.mozilla.org/mozilla-central/rev/1857e763332c. Pending spec change: w3c/FileAPI#41 Differential Revision: https://phabricator.services.mozilla.com/D86981
Change the test to follow the proposed change in w3c/FileAPI#41, now that all browsers agree to not replace /. Depends on D86981 Differential Revision: https://phabricator.services.mozilla.com/D87112
The WPTs now expect no replacement, but the spec still says replacement must happen. Can we fix the spec? |
This was added in 5cd3dda, allegedly in response to https://www.w3.org/Bugs/Public/show_bug.cgi?id=23147. Neither Chrome nor Gecko seems to implement it.
The text was updated successfully, but these errors were encountered: