Add the FileSystemFileHandle.move method - #180
Conversation
| </div> | ||
|
|
||
| <div algorithm> | ||
| The <dfn method for=FileSystemFileHandle>move({{FileSystemDirectoryHandle}}: |destinationDirectory|)</dfn> |
There was a problem hiding this comment.
We don't list the types here. This should maybe also use <p> as in the output all these algorithms look squished together.
There was a problem hiding this comment.
Removed the types from the algorithm headers (hopefully I didn't miss any).
I chose not to use <p> since it currently only appears twice in the entire document, at the footer. If we want to use <p> in more places for clarity, I think it's better to do that consistently as a separate change than to introduce it here.
| with "`exclusive`" on |entry|. | ||
|
|
||
| 1. If |destinationEntry| is not `null`: | ||
| 1. Let |destinationLockResult| be the result of |
There was a problem hiding this comment.
Initialize this variable in the outer scope once for clarity as you need it later. And then overwrite it for this non-null case. We usually keep "null" without markup btw, not null, just null.
There was a problem hiding this comment.
Initialized it to "not taken", overwriting it inside the conditional.
I also changed all the uses of null in the new section to plain "null". There are some other pre-existing areas that use null; maybe another editorial change for later.
|
We in Mozilla found that the API form is easy to fire a footgun, see: whatwg/webidl#1604 |
|
@saschanaz My phrasing in the initial writeup was a bit unclear. All three major browsers currently ship the Un-shipping the |
|
We found the usage of move is very very low at 0.00003%, I think that's an ok level to try renaming it. (I'm not saying we should remove the feature.) Blink's telemetry names also say "rename" and "reparent" so the current overloading is unfortunate. |
|
BTW, Blink just landed move support for directory handles, should we go back to #10 ? |
An earlier version of this was proposed in #10, but stalled out due to complications around moving directories.
When looking into it, I was therefore surprised to find that this method (at least, a subset of it) has shipped in browsers since late 2021!
Apparently, Firefox and WebKit both shipped (early versions of) this method without a flag, and have kept them ever since. Chromium added and has shipped these methods to the public IDL of
FileSystemFileHandle. They did so in a commit that claimed only to remove them fromFileSystemHandle. (A slightly-later update changed the single-argument version fromrenametomove.)I've taken #10 and adjusted it to match what Chrome has actually been shipping, in the hope that it can be standardized and documented. In particular, directory entries can no longer be moved, and the
movemethod has been moved fromFileSystemHandletoFileSystemFileHandle.Aside from just moving things around in the spec, there are a couple other changes:
I've reworded the non-normative sections slightly, since Bikeshed now warns if you use the word "may" in a non-normative section.
I've removed a couple steps in the algorithm that only exist to handle edge cases around moving directories. These steps were ensuring a directory could not be moved within itself, and ensuring the root of a bucket file system could not be moved.
The rewording is in its own commit, to make it easier to review that diff specifically.
FileSystemHandle.FileSystemHandle.FileSystemHandletoFileSystemFileHandle)FileSystemHandletoFileSystemFileHandle, and add the other two overload signatures)💥 Error: 422 Unprocessable Entity 💥
PR Preview failed to build. (Last tried on Jul 27, 2026, 11:49 AM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 Spec Generator - Spec Generator is the web service used to build bikeshed/ReSpec specs
🔗 Related URL
Error output:
[ { "lineNum": "113", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "247", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "358", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "767", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "793", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "811", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "890", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "984", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "1125", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "1206", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "1277", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": "1713", "messageType": "fatal", "text": "Saw numeric issue markup, but can't find either a GitHub repo or manual Issue Tracker Template to format it." }, { "lineNum": null, "messageType": "failure", "text": "Did not generate, due to errors exceeding the allowed error level." } ]This seems to be an issue with the Spec Generator service. PR Preview doesn't manage this service and so has no control over it. If you've identified an issue with it, you can report the issue to the maintainers of Spec Generator directly. Please be courteous. Thank you!
If you don't have enough information above to solve the error by yourself or if the issue doesn't seem related to Spec Generator, you can file an issue with PR Preview.