Consider including the name of the directory picked by HTMLInputElement.openDirectoryPicker() in File.path

RESOLVED FIXED in mozilla27

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

Trunk
mozilla27
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
I think we should consider including the name of the directory picked by HTMLInputElement.openDirectoryPicker() in File.path for the files that are picked. Currently the path is relative to this directory, not including the directory's name.
Oh, yeah, I agree we should include the picked directory's name.
(Assignee)

Comment 2

5 years ago
Created attachment 812527 [details] [diff] [review]
patch
Assignee: nobody → jwatt
Status: NEW → ASSIGNED
Attachment #812527 - Flags: review?(jonas)
Comment on attachment 812527 [details] [diff] [review]
patch

Review of attachment 812527 [details] [diff] [review]:
-----------------------------------------------------------------

r=me either way.

::: content/html/content/src/HTMLInputElement.cpp
@@ +360,5 @@
> +    if (NS_FAILED(aTopDir->GetParent(getter_AddRefs(mTopDirsParent))) {
> +      // This just means that the name of the picked directory won't be
> +      // included in the File.path string.
> +      mTopDirsParent = aTopDir;
> +    }

I would just do

rv = aTopDir->GetParent(...);
NS_ENSURE_SUCCESS(rv, rv);

It seems unlikely that this will fail while the rest of the code would still work.

Up to you though.
Attachment #812527 - Flags: review?(jonas) → review+

Comment 6

5 years ago
https://hg.mozilla.org/mozilla-central/rev/32c6282f3a29
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.