-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conditionally exclude crossorigin attribute when saving web page reso…
…urces 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
- Loading branch information
Showing
3 changed files
with
142 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters