Skip to content

FileSystemHandle: add more serialization coverage#59933

Merged
annevk merged 2 commits into
masterfrom
annevk/filesystemhandle
May 18, 2026
Merged

FileSystemHandle: add more serialization coverage#59933
annevk merged 2 commits into
masterfrom
annevk/filesystemhandle

Conversation

@annevk
Copy link
Copy Markdown
Member

@annevk annevk commented May 17, 2026

No description provided.

@annevk annevk requested a review from noamr May 18, 2026 06:40
@annevk annevk enabled auto-merge (squash) May 18, 2026 06:40
webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request May 18, 2026
…oth handles

https://bugs.webkit.org/show_bug.cgi?id=314973

Reviewed by Sihui Liu.

isSameEntry only called ensureIdentifier on `this`; the other handle's
m_identifier was assumed to already be set. That assumption holds when
the handle was created via getFileHandle / getDirectoryHandle, since
the WebProcess gets a FileSystemHandleIdentifier as part of the
roundtrip. It does not hold for a handle that was deserialized from
postMessage / structuredClone: the deserializer constructs the handle
with an empty Markable<FileSystemHandleIdentifier> and calls
markAsUnresolved, so handle->identifier() (which is *m_identifier)
release-asserts in Markable.h.

Test: imported/w3c/web-platform-tests/fs/script-tests/FileSystemBaseHandle-isSameEntry.js

Upstream: web-platform-tests/wpt#59933
Canonical link: https://commits.webkit.org/313396@main
annevk added a commit to annevk/WebKit that referenced this pull request May 18, 2026
https://bugs.webkit.org/show_bug.cgi?id=314974

Reviewed by NOBODY (OOPS!).

navigator.storage.getDirectory() constructed the root
FileSystemDirectoryHandle with a null string for its name argument.
Round-tripping the handle through structured clone results in an
empty string. This means that isSameEntry() will treat them
differently. The specification uses an empty string so follow that.

Test: imported/w3c/web-platform-tests/fs/script-tests/FileSystemBaseHandle-isSameEntry.js

Upstream: web-platform-tests/wpt#59933
webkit-commit-queue pushed a commit to annevk/WebKit that referenced this pull request May 18, 2026
https://bugs.webkit.org/show_bug.cgi?id=314974

Reviewed by Sihui Liu.

navigator.storage.getDirectory() constructed the root
FileSystemDirectoryHandle with a null string for its name argument.
Round-tripping the handle through structured clone results in an
empty string. This means that isSameEntry() will treat them
differently. The specification uses an empty string so follow that.

Test: imported/w3c/web-platform-tests/fs/script-tests/FileSystemBaseHandle-isSameEntry.js

Upstream: web-platform-tests/wpt#59933
Canonical link: https://commits.webkit.org/313397@main
@annevk annevk merged commit 7f18479 into master May 18, 2026
27 checks passed
@annevk annevk deleted the annevk/filesystemhandle branch May 18, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants