[webkit-changes] [WebKit/WebKit] 14b282: `change` event for input[type=file] does not fire ...

Richard Robinson noreply at github.com
Fri Oct 7 15:22:23 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 14b28281c8d06ca7fed8f17777c1f071d4e52d5f
      https://github.com/WebKit/WebKit/commit/14b28281c8d06ca7fed8f17777c1f071d4e52d5f
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2022-10-07 (Fri, 07 Oct 2022)

  Changed paths:
    M Source/WTF/wtf/FileSystem.h
    M Source/WTF/wtf/glib/FileSystemGlib.cpp
    M Source/WTF/wtf/posix/FileSystemPOSIX.cpp
    M Source/WTF/wtf/win/FileSystemWin.cpp
    M Source/WebCore/fileapi/File.cpp
    M Source/WebCore/fileapi/File.h
    M Source/WebCore/html/FileInputType.cpp
    M Source/WebCore/platform/FileChooser.cpp

  Log Message:
  -----------
  `change` event for input[type=file] does not fire when different file with same name is selected
https://bugs.webkit.org/show_bug.cgi?id=187084
rdar://98460303

Reviewed by Ryosuke Niwa and Aditya Keerthi.

When a different file with the same name as the currently selected file is selected,
the `change` event does not currently fire, because a file's path is it's
identifier, so the two files are considered the same by the system.

This PR works around this by saving each file's unique id and then comparing the files
both based on their name and now their id too.

* Source/WTF/wtf/FileSystem.h:
* Source/WTF/wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::fileID):
(WTF::FileSystemImpl::fileIDsAreEqual):
(WTF::FileSystemImpl::08c7e637e60a):
(WTF::FileSystemImpl::fileCreationTime): Deleted.
* Source/WTF/wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::fileID):
(WTF::FileSystemImpl::fileIDsAreEqual):
* Source/WTF/wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::fileID):
(WTF::FileSystemImpl::fileIDsAreEqual):
* Source/WebCore/fileapi/File.cpp:
(WebCore::File::create):
(WebCore::File::File):
* Source/WebCore/fileapi/File.h:
* Source/WebCore/html/FileInputType.cpp:
(WebCore::FileInputType::setFiles):
(WebCore::FileInputType::filesChosen):
* Source/WebCore/platform/FileChooser.cpp:
(WebCore::FileChooser::chooseFiles):
(WebCore::FileChooser::chooseMediaFiles):

Canonical link: https://commits.webkit.org/255297@main




More information about the webkit-changes mailing list