Bug 63484

Summary: [Windows, WinCairo] Don't Attempt to Create Zero-Size DIB
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, eric, jhoneycutt
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   
Attachments:
Description Flags
Patch aroben: review+

Description Brent Fulgham 2011-06-27 14:44:53 PDT
While investigating a separate issue, I noticed that I was hitting an assertion in the Cairo drawing layer because it was attempting to use an invalid HBITMAP created in the WebNodeHighlight::update method.  The underlying issue was that the CreateDIBSection function was failing, because it was being requested to create a section of zero height.

I think the attached patch would be safe for the CoreGraphics and Cairo ports, but wanted to see if anyone knew of a reason why it would be bad to exit early in the case of a zero height (or zero width) paint region.
Comment 1 Brent Fulgham 2011-06-27 14:51:38 PDT
Created attachment 98790 [details]
Patch
Comment 2 Adam Roben (:aroben) 2011-06-28 08:10:55 PDT
Comment on attachment 98790 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=98790&action=review

> Source/WebKit/win/WebNodeHighlight.cpp:155
> +    ASSERT_WITH_MESSAGE(hbmp.get(), "::CreateDIBSection failed with error %lu", ::GetLastError());

No need for the .get() here.
Comment 3 Brent Fulgham 2011-06-28 08:42:31 PDT
Committed r89932: <http://trac.webkit.org/changeset/89932>