Skip to content

Commit

Permalink
webkitRelativePath: Remove 'shortest common ancestor' requirement (Fixes
Browse files Browse the repository at this point in the history
 #18)

This was based on a quirk in Chrome, but none of Edge/Safari/Firefox follow it. Chrome is updating to match the other browsers. Test update coming in web-platform-tests/wpt#13988
  • Loading branch information
inexorabletash committed Nov 9, 2018
1 parent bd95000 commit e6b848f
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions index.bs
Expand Up @@ -313,10 +313,8 @@ directory rather than a file or files. When specified, the behavior on
the selection of a directory is as if all files with that directory as
an ancestor were selected. In addition, the
{{File/webkitRelativePath}} property of each {{File}} is set to a
[=relative path=] from the shortest common ancestor directory of all
selected files to that file, including that ancestor in the path.
(Therefore this may be a subdirectory of the selected directory
rather than the directory itself.)
[=relative path=] starting from (and including) the selected directory
to the file.

<aside class=example>
Given the following directory structure:
Expand All @@ -326,19 +324,18 @@ rather than the directory itself.)
to_upload/
a/
b/
c/
d/
1.txt
2.txt
3.txt
1.txt
2.txt
3.txt
not_uploaded.txt
</xmp>

If the `to_upload` directory was selected, then
{{HTMLInputElement/files}} would include:

* An entry with {{File/name}} == "`1.txt`" and {{File/webkitRelativePath}} == "`c/d/1.txt`"
* An entry with {{File/name}} == "`2.txt`" and {{File/webkitRelativePath}} == "`c/d/2.txt`"
* An entry with {{File/name}} == "`3.txt`" and {{File/webkitRelativePath}} == "`c/3.txt`"
* An entry with {{File/name}} == "`1.txt`" and {{File/webkitRelativePath}} == "`to_upload/a/b/1.txt`"
* An entry with {{File/name}} == "`2.txt`" and {{File/webkitRelativePath}} == "`to_upload/a/b/2.txt`"
* An entry with {{File/name}} == "`3.txt`" and {{File/webkitRelativePath}} == "`to_upload/a/3.txt`"

</aside>

Expand Down Expand Up @@ -1014,6 +1011,7 @@ And thanks to
Ali Alabbas,
Philip Jägenstedt,
Marijn Kruisselbrink,
Olli Pettay,
and
Olli Pettay
Kent Tamura
for suggestions, reviews, and other feedback.

0 comments on commit e6b848f

Please sign in to comment.