Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6e308cecbfca679453a425952ebc5d789ad2b06f
https://github.com/WebKit/WebKit/commit/6e308cecbfca679453a425952ebc5d789ad2b06f
Author: Anthony Tarbinian <[email protected]>
Date: 2026-04-03 (Fri, 03 Apr 2026)
Changed paths:
M LayoutTests/http/tests/security/file-system-access-via-dataTransfer.html
Log Message:
-----------
Directory path is incorrect in
http/tests/security/file-system-access-via-dataTransfer.html
https://bugs.webkit.org/show_bug.cgi?id=311436
rdar://174033719
Reviewed by Matthew Finkel.
In http/tests/security/file-system-access-via-dataTransfer.html ,
the targetDirectory variable doesn't have the path of a valid directory.
This is what the code looks like:
```
let path = location.pathname.split("/");
let filename = path[path.length - 1];
let targetFileName = internals.createTemporaryFile(`${filename}`, "");
let targetDirectory = targetFileName.substring(0, targetFileName.length -
filename);
```
Note that targetDirectory is created by taking the substring of targetFileName,
however the end of the substring is calculated by doing `targetFileName.length
- filename`
where filename is a string, not a number. This should be `filename.length`
instead. However even when making that change, the targetDirectory still isn't
quite right. See the following debugging logs:
```
path: ["","security","file-system-access-via-dataTransfer.html"]
filename: file-system-access-via-dataTransfer.html
targetFileName:
/var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-w8rnouln/WebCoreTesting-file-system-access-via-dataTransfer.htmlnc3lIz
targetDirectory:
/var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-w8rnouln/WebCoreTesting-file-s
```
Note how targetDirectory has some trailing characters of "WebCoreTesting-file-s"
after the directory path. It seems like `internals.createTemporaryFile`
is padding some extra characters onto the original filename.
This patch updates how targetDirectory is created by chopping off
the full filename from the path of targetFileName. This is what
targetDirectory looks like now:
```
path: ["","security","file-system-access-via-dataTransfer.html"]
filename: file-system-access-via-dataTransfer.html
targetFileName:
/var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-arclxndi/WebCoreTesting-file-system-access-via-dataTransfer.htmljaLOWz
targetDirectory:
/var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-arclxndi
```
* LayoutTests/http/tests/security/file-system-access-via-dataTransfer.html:
Canonical link: https://commits.webkit.org/310549@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications