Skip to content
Permalink
Browse files
2011-11-08 Nikolas Zimmermann <nzimmermann@rim.com>
        Switch SVGImage cache to store ImageBuffers instead of whole SVGImages, including a DOM/Render tree
        https://bugs.webkit.org/show_bug.cgi?id=71368

        Reviewed by Zoltan Herczeg.

        When determining whether the canvas would be tainted, we need access to the SVGImage, not its cached BitmapImage.
        Otherwhise wrong assumptions are mode, leading to regressions.

        Fixes http/tests/security/canvas-remote-read-svg-image.html and related tests on the bots.

        * html/canvas/CanvasRenderingContext.cpp:
        (WebCore::CanvasRenderingContext::wouldTaintOrigin): Forgot to switch them back to use cachedImage->image().
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::isOriginClean): Ditto.


Canonical link: https://commits.webkit.org/88116@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@99543 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Nikolas Zimmermann committed Nov 8, 2011
1 parent a58864a commit f1b224cae62953a2ac9a5fa2fef395c277652bb6
Showing 3 changed files with 19 additions and 2 deletions.
@@ -1,3 +1,20 @@
2011-11-08 Nikolas Zimmermann <nzimmermann@rim.com>

Switch SVGImage cache to store ImageBuffers instead of whole SVGImages, including a DOM/Render tree
https://bugs.webkit.org/show_bug.cgi?id=71368

Reviewed by Zoltan Herczeg.

When determining whether the canvas would be tainted, we need access to the SVGImage, not its cached BitmapImage.
Otherwhise wrong assumptions are mode, leading to regressions.

Fixes http/tests/security/canvas-remote-read-svg-image.html and related tests on the bots.

* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin): Forgot to switch them back to use cachedImage->image().
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::isOriginClean): Ditto.

2011-11-08 Vsevolod Vlasov <vsevik@chromium.org>

Web Inspector: Console should be scrolled to bottom when shown for the first time.
@@ -61,7 +61,7 @@ bool CanvasRenderingContext::wouldTaintOrigin(const HTMLImageElement* image)
return false;

CachedImage* cachedImage = image->cachedImage();
if (!cachedImage->imageForRenderer(image->renderer())->hasSingleSecurityOrigin())
if (!cachedImage->image()->hasSingleSecurityOrigin())
return true;

return wouldTaintOrigin(cachedImage->response().url()) && !cachedImage->passesAccessControlCheck(canvas()->securityOrigin());
@@ -87,7 +87,7 @@ static const char* const defaultFont = "10px sans-serif";

static bool isOriginClean(CachedImage* cachedImage, HTMLImageElement* image, SecurityOrigin* securityOrigin)
{
if (!cachedImage->imageForRenderer(image->renderer())->hasSingleSecurityOrigin())
if (!cachedImage->image()->hasSingleSecurityOrigin())
return false;
if (cachedImage->passesAccessControlCheck(securityOrigin))
return true;

0 comments on commit f1b224c

Please sign in to comment.