[webkit-changes] [WebKit/WebKit] a1d6f4: Exclude base element when saving web page resources

Sihui noreply at github.com
Wed Jan 10 18:02:28 PST 2024


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

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

  Log Message:
  -----------
  Exclude base element when saving web page resources
https://bugs.webkit.org/show_bug.cgi?id=267236
rdar://120495615

Reviewed by Ryosuke Niwa and BJ Burg.

When saving complete web page, subresources URLs are rewritten to relative file paths based on main resource file path.
If the saved web page has base element, when it is loaded, the rewritten URLs are resolved based on the URL specified by
base element, and the result can be invalid. To fix that, this patch excludes base element when saving complete web
page, and replaces relative URLs (that are not rewritten) with complete URLs.

API Test: WebArchive.SaveResourcesExcludeBaseElement

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

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




More information about the webkit-changes mailing list