From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 20 Sep 2018 17:45:00 -0700 Subject: blink_file_path.patch This is used by editors to obtain the filesystem path from a dragged file. See documentation at https://electronjs.org/docs/api/file-object diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h index 888fb19b976194c173286f92b26c4bc9362bcf9c..9d243bc70089685f018b14eba0025cfd11bb82f6 100644 --- a/third_party/blink/renderer/core/fileapi/file.h +++ b/third_party/blink/renderer/core/fileapi/file.h @@ -193,6 +193,9 @@ class CORE_EXPORT File final : public Blob { } const String& name() const { return name_; } + // Getter for the path IDL attribute. + const String& path() const { return GetPath(); } + // Getter for the lastModified IDL attribute, // http://dev.w3.org/2006/webapi/FileAPI/#file-attrs int64_t lastModified() const; diff --git a/third_party/blink/renderer/core/fileapi/file.idl b/third_party/blink/renderer/core/fileapi/file.idl index 8113ac9050c25a675eb20c90fdb4d037e171a5b6..9ca2d532dc4694d7a68ebd6b7988907132dae0e9 100644 --- a/third_party/blink/renderer/core/fileapi/file.idl +++ b/third_party/blink/renderer/core/fileapi/file.idl @@ -31,6 +31,7 @@ ] interface File : Blob { [CallWith=ExecutionContext] constructor(sequence fileBits, USVString fileName, optional FilePropertyBag options); readonly attribute DOMString name; + readonly attribute DOMString path; readonly attribute long long lastModified; // Non-standard APIs