https://bugs.webkit.org/show_bug.cgi?id=67898
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2011 21:52:01 +0000 (21:52 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Sep 2011 21:52:01 +0000 (21:52 +0000)
REGRESSION(r94900): fast/images/support-broken-image-delegate.html fails on Mac

Reviewed by Simon Fraser.

Source/WebCore:

New function willPaintBrokenImage() returns true when there has been an error
loading the image and the broken image icon will be used in its place. This is
necessary since it is possible to have an error loading an image and to NOT use
the broken image icon.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::willPaintBrokenImage):
* loader/cache/CachedImage.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageSizeForError):

LayoutTests:

* platform/mac/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94980 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac/Skipped
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/rendering/RenderImage.cpp

index 023902e..0a4494a 100644 (file)
@@ -1,3 +1,12 @@
+2011-09-12  Beth Dakin  <bdakin@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=67898
+        REGRESSION(r94900): fast/images/support-broken-image-delegate.html fails on Mac
+
+        Reviewed by Simon Fraser.
+
+        * platform/mac/Skipped:
+
 2011-09-12  Ryosuke Niwa  <rniwa@webkit.org>
 
         Fix a test added by r94966 to work on Mac.
index 4c2b465..4ff2392 100644 (file)
@@ -420,6 +420,3 @@ http/tests/loading/progress-finished-callback.html
 
 # https://bugs.webkit.org/show_bug.cgi?id=67716
 media/media-controls-invalid-url.html
-
-# https://bugs.webkit.org/show_bug.cgi?id=67898
-fast/images/support-broken-image-delegate.html
index 464f2f0..d4d7228 100644 (file)
@@ -1,3 +1,20 @@
+2011-09-12  Beth Dakin  <bdakin@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=67898
+        REGRESSION(r94900): fast/images/support-broken-image-delegate.html fails on Mac
+
+        Reviewed by Simon Fraser.
+
+        New function willPaintBrokenImage() returns true when there has been an error 
+        loading the image and the broken image icon will be used in its place. This is 
+        necessary since it is possible to have an error loading an image and to NOT use 
+        the broken image icon. 
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::willPaintBrokenImage):
+        * loader/cache/CachedImage.h:
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::imageSizeForError):
+
 2011-09-12  James Robinson  <jamesr@chromium.org>
 
         [chromium] Move contents texture manager from LayerRendererChromium to CCLayerTreeHost
index d4a834f..abec349 100644 (file)
@@ -124,6 +124,11 @@ Image* CachedImage::brokenImage(float deviceScaleFactor) const
     return brokenImageLoRes;
 }
 
+bool CachedImage::willPaintBrokenImage() const
+{
+    return errorOccurred() && m_shouldPaintBrokenImage;
+}
+
 Image* CachedImage::image() const
 {
     ASSERT(!isPurgeable());
index 29d4214..2fcad95 100644 (file)
@@ -48,6 +48,7 @@ public:
     bool hasImage() const { return m_image.get(); }
 
     Image* brokenImage(float deviceScaleFactor) const;
+    bool willPaintBrokenImage() const; 
 
     bool canRender(float multiplier) const { return !errorOccurred() && !imageSize(multiplier).isEmpty(); }
 
index 7292456..e372659 100644 (file)
@@ -84,7 +84,11 @@ IntSize RenderImage::imageSizeForError(CachedImage* newImage) const
     ASSERT_ARG(newImage, newImage);
     ASSERT_ARG(newImage, newImage->image());
 
-    Image* brokenImage = newImage->brokenImage(Page::deviceScaleFactor(frame()));
+    Image* brokenImage;
+    if (newImage->willPaintBrokenImage())
+        brokenImage = newImage->brokenImage(Page::deviceScaleFactor(frame()));
+    else
+        brokenImage = newImage->image();
 
     // imageSize() returns 0 for the error image. We need the true size of the
     // error image, so we have to get it by grabbing image() directly.