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

Richard Robinson noreply at github.com
Wed Oct 5 22:58:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5374937e8566ca95b1adefe78fc7b2d90f6497ee
      https://github.com/WebKit/WebKit/commit/5374937e8566ca95b1adefe78fc7b2d90f6497ee
  Author: Richard Robinson <richard_robinson2 at apple.com>
  Date:   2022-10-05 (Wed, 05 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.

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/WebCore/fileapi/File.cpp:
(WebCore::File::create):
(WebCore::File::File):
* Source/WebCore/fileapi/File.h:
* Source/WebCore/html/FileInputType.cpp:
(WebCore::FileInputType::setFiles):
* Source/WebCore/platform/FileChooser.cpp:
(WebCore::FileChooser::chooseFiles):

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




More information about the webkit-changes mailing list