[webkit-changes] [WebKit/WebKit] 5cfdac: Rename Image::hasSingleSecurityOrigin to Image::re...

mattwoodrow noreply at github.com
Mon Jan 16 17:27:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5cfdacb9f77cffe585529fa7a25afc82234403c9
      https://github.com/WebKit/WebKit/commit/5cfdacb9f77cffe585529fa7a25afc82234403c9
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-01-16 (Mon, 16 Jan 2023)

  Changed paths:
    M Source/WebCore/html/ImageBitmap.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext.cpp
    M Source/WebCore/html/canvas/CanvasRenderingContext.h
    M Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
    M Source/WebCore/platform/graphics/BitmapImage.h
    M Source/WebCore/platform/graphics/GeneratedImage.h
    M Source/WebCore/platform/graphics/Image.h
    M Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
    M Source/WebCore/svg/SVGFEImageElement.cpp
    M Source/WebCore/svg/SVGFEImageElement.h
    M Source/WebCore/svg/SVGImageElement.cpp
    M Source/WebCore/svg/SVGImageElement.h
    M Source/WebCore/svg/graphics/SVGImage.cpp
    M Source/WebCore/svg/graphics/SVGImage.h

  Log Message:
  -----------
  Rename Image::hasSingleSecurityOrigin to Image::renderingTaintsOrigin.
https://bugs.webkit.org/show_bug.cgi?id=250540
<rdar://102738351>

Reviewed by Darin Adler.

There's only two entry points to this function, and one of them (CanvasRenderingContext) only calls it when the image is a SVGImage.

The only interesting implementation of this (SVGImage) is not related to multiple origins (or CORS at all), but instead to SVG foreign object possibly tainting the <canvas> in a different way (by drawing visited colours, spellcheck etc).

This renames the function to renderingTaintsOrigin, since that more accurately reflects the behaviour. It also swaps the meaning in the process, and removes lots of overloads which aren't needed.

The only (potential) behaviour change is that the ImageBitmap callsite (which didn't have an isSVGImage check) will now definitely only affect SVGImages instead of other types (which implicitly returned false for hasSingleSecurity origin by not overloading the function). I believe that was the intent of the change which added the check to the other callsite (and that returning false for !SVG was a missing impl bug), and this was just missed.

* Source/WebCore/html/ImageBitmap.cpp:
(WebCore::taintsOrigin):
* Source/WebCore/html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::taintsOrigin):
(WebCore::CanvasRenderingContext::checkOrigin):
(WebCore::CanvasRenderingContext::wouldTaintOrigin): Deleted.
* Source/WebCore/html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::checkOrigin):
* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
(WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement):
(WebCore::WebGLRenderingContextBase::validateHTMLVideoElement):
* Source/WebCore/platform/graphics/BitmapImage.h:
* Source/WebCore/platform/graphics/GeneratedImage.h:
* Source/WebCore/platform/graphics/Image.h:
(WebCore::Image::renderingTaintsOrigin const):
(WebCore::Image::hasSingleSecurityOrigin const): Deleted.
* Source/WebCore/platform/graphics/cg/PDFDocumentImage.h:
* Source/WebCore/svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::renderingTaintsOrigin const):
(WebCore::SVGFEImageElement::hasSingleSecurityOrigin const): Deleted.
* Source/WebCore/svg/SVGFEImageElement.h:
* Source/WebCore/svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::renderingTaintsOrigin const):
(WebCore::SVGImageElement::hasSingleSecurityOrigin const): Deleted.
* Source/WebCore/svg/SVGImageElement.h:
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::renderingTaintsOrigin const):
(WebCore::SVGImage::hasSingleSecurityOrigin const): Deleted.
* Source/WebCore/svg/graphics/SVGImage.h:

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




More information about the webkit-changes mailing list