[webkit-changes] [WebKit/WebKit] 5b6703: Conditionally exclude crossorigin attribute when s...

Sihui noreply at github.com
Wed Mar 13 12:58:04 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5b67039b6533405bf352d6071aff8fbb8aca5519
      https://github.com/WebKit/WebKit/commit/5b67039b6533405bf352d6071aff8fbb8aca5519
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    M Source/WebCore/editing/MarkupAccumulator.cpp
    M Source/WebCore/editing/MarkupAccumulator.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm

  Log Message:
  -----------
  Conditionally exclude crossorigin attribute when saving web page resources
https://bugs.webkit.org/show_bug.cgi?id=270874
rdar://124074708

Reviewed by Ryosuke Niwa.

When saving complete web page, we may replace URLs of elements with relative paths that point to saved subresource
files. In this case, we should drop crossorigin attribute on these elements, otherwise the saved page may not have
subresources loaded correctly as browsers can perform CORS checks on the element (e.g. requiring response to contain
Access-Control-Allow-Origin header).

Test: WebArchive.SaveResourcesExcludeCrossOriginAttribute

* Source/WebCore/editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::resolveURLIfNeeded const):
(WebCore::isURLAttributeForElement):
(WebCore::MarkupAccumulator::appendStartTag):
(WebCore::MarkupAccumulator::appendURLAttributeForReplacementIfNecessary):
(WebCore::MarkupAccumulator::appendAttribute):
(WebCore::MarkupAccumulator::appendURLAttributeIfNecessary): Deleted.
* Source/WebCore/editing/MarkupAccumulator.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/CreateWebArchive.mm:

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list