Garbage on page background while http://canberraballoons.com.au is loading
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 May 2013 19:09:07 +0000 (19:09 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 May 2013 19:09:07 +0000 (19:09 +0000)
commita4bbcb8956cd76fb6def368247266a5ca4bf591a
treeaa769f146e87bf908b3d8b27adcca19be5b3a8c4
parent5b91b8aa5aa107480608aa7c2eee8d59884e263c
Garbage on page background while canberraballoons.com.au is loading
https://bugs.webkit.org/show_bug.cgi?id=116384
<rdar://problem/13930328>

Reviewed by Dan Bernstein.

This page loads a large JPEG image as the body background.
ImageSource::frameHasAlphaAtIndex() always claims that JPEG images
are opaque, but this isn't true if the frame is only partially loaded.
However, this would cause FillLayer::hasOpaqueImage() to report that the
background image is opaque, so we'd skip painting the background color.
Unpainted content in an opaque layer results in garbage.

Fix by having ImageSource::frameHasAlphaAtIndex() always return true
for frames that are not complete. When the image load completes, we
recompute metadata and correctly determine that the frame is opaque.

* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::frameHasAlphaAtIndex):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp