[webkit-changes] [WebKit/WebKit] f2cf99: [fetch] Add Initiator associated with a resource r...

Matthew Finkel noreply at github.com
Tue Dec 27 12:41:27 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f2cf9958d49b88d049bbdcbe60abdc00731910c3
      https://github.com/WebKit/WebKit/commit/f2cf9958d49b88d049bbdcbe60abdc00731910c3
  Author: Matthew Finkel <sysrqb at apple.com>
  Date:   2022-12-27 (Tue, 27 Dec 2022)

  Changed paths:
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/html/HTMLImageElement.h
    M Source/WebCore/loader/ImageLoader.cpp
    M Source/WebCore/loader/ResourceLoaderOptions.h
    M Source/WebCore/loader/ThreadableLoader.cpp

  Log Message:
  -----------
  [fetch] Add Initiator associated with a resource request
https://bugs.webkit.org/show_bug.cgi?id=248623
rdar://problem/102872475

Reviewed by Youenn Fablet.

A resource request may have an "initiator" [0] associated with it. This value
is used in various situation for making security-related decisions. For
example, when loading mixed content, an image may be blocked [1] if it uses a
srcset or if it's a child of a picture element [2]. In this patch, minimal
support is added by defining ResourceLoaderOptions::Initiator and applying
ResourceLoaderOptions::Initiator::Imageset.

[0] https://fetch.spec.whatwg.org/#concept-request-initiator
[1] https://www.w3.org/TR/mixed-content/#category-upgradeable
[2] https://html.spec.whatwg.org/#use-srcset-or-picture

* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::usesSrcsetOrPicture const):
* Source/WebCore/html/HTMLImageElement.h:
* Source/WebCore/loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* Source/WebCore/loader/ResourceLoaderOptions.h:
(WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
* Source/WebCore/loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::isolatedCopy const):

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




More information about the webkit-changes mailing list