Closed Bug 912489 Opened 11 years ago Closed 11 years ago

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

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

Attachments

(1 file)

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.
Attached patch patchSplinter Review
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+
https://hg.mozilla.org/mozilla-central/rev/32c6282f3a29
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: