Bug 113268 - Cleanup Image::hasImage() (and related hasImage functions)
Summary: Cleanup Image::hasImage() (and related hasImage functions)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-25 20:01 PDT by Philip Rogers
Modified: 2013-03-25 20:01 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Rogers 2013-03-25 20:01:14 PDT
RenderImageResource::hasImage() returns whether the image resource has a cached image. CachedImage::hasImage() returns whether a cached image has an image.

Various codepaths do various checks. Here are two examples:

http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderImage.cpp?rev=146279#L378
RenderImage checks hasImage(), then checks if the image is null.

http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/svg/RenderSVGImage.cpp#L118
RenderSVGImage checks hasImage() but does not check for null or nullimage, and will pass a null image to context->drawImage()

This isn't easy to understand; we should clean this up.