[webkit-changes] [WebKit/WebKit] 60be86: Resources with duplicate names have weird file nam...

Sihui noreply at github.com
Tue Jan 16 14:14:19 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 60be8686d562e762be6567fa3a9d59a62528a7bf
      https://github.com/WebKit/WebKit/commit/60be8686d562e762be6567fa3a9d59a62528a7bf
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-01-16 (Tue, 16 Jan 2024)

  Changed paths:
    M Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm

  Log Message:
  -----------
  Resources with duplicate names have weird file names when saved to disk
https://bugs.webkit.org/show_bug.cgi?id=267472
rdar://120925081

Reviewed by Ryosuke Niwa and BJ Burg.

In current implementation, unique file name is generated by keeping appending number to extracted file name. For
example, if there are three subresources named "image", their file names can be image-1", "image-1-2", "image-1-2-3".
This patch fixes the prolem by appending only one number to the extracted name. After this change, the results will be
"image-1", "image-2" and "image-3".

Updated API test: WebArchive.SaveResourcesValidFileName

* Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::generateValidFileName):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm:

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




More information about the webkit-changes mailing list