Bug 18445 - Assertion failure in CSSGradientValue::image() when the body element has a background gradient
Summary: Assertion failure in CSSGradientValue::image() when the body element has a ba...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 19030 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-12 15:31 PDT by mitz
Modified: 2009-05-30 10:58 PDT (History)
6 users (show)

See Also:


Attachments
Test case (will ASSERT) (114 bytes, text/html)
2008-04-12 15:33 PDT, mitz
no flags Details
testcases for gradient and canvas on body (1.33 KB, patch)
2008-12-03 18:14 PST, Dean Jackson
no flags Details | Formatted Diff | Diff
Change paintFillLayerExtended() to use body's renderer as the StyleImage client when the background is propagated from body to root (155.19 KB, patch)
2009-05-30 00:04 PDT, mitz
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2008-04-12 15:31:01 PDT
Failing the ASSERT(m_clients.contains(renderer)) in CSSGradientValue::image() because the body's background propagates to the root. See attached test case.
Comment 1 mitz 2008-04-12 15:33:58 PDT
Created attachment 20494 [details]
Test case (will ASSERT)
Comment 2 mitz 2008-05-13 08:40:38 PDT
*** Bug 19030 has been marked as a duplicate of this bug. ***
Comment 3 Adam Roben (:aroben) 2008-05-13 08:41:39 PDT
<rdar://problem/5931174>
Comment 4 Dean Jackson 2008-12-03 18:12:38 PST
Note that -webkit-canvas has the same problem.
ASSERT(m_clients.contains(renderer));
in CSSCanvasValue::image

There are a few options.

1. add the canvas and gradient as clients before asking for the images. I expect this wastes memory in the case where a canvas/gradient is set on the body, then removed.

2. remove the asserts. Since gradient calls getImage and it causes the renderer to be added as a client I don't think it is a big deal, but I didn't investigate much. I didn't try this with canvas.

3. Work out why body elements are not doing the right thing with updateFillImages from RenderObject::setStyle, which is where other elements add gradients and canvas as clients.

Comment 5 Dean Jackson 2008-12-03 18:14:55 PST
Created attachment 25730 [details]
testcases for gradient and canvas on body

here are two layout tests that will trigger the assert
Comment 6 mitz 2008-12-03 18:33:11 PST
(In reply to comment #4)

> 3. Work out why body elements are not doing the right thing with
> updateFillImages from RenderObject::setStyle, which is where other elements add
> gradients and canvas as clients.

I think this is the first option to pursue. If I am not mistaken, it has to do with the special rules for background-image propagation from <body> to <html>.
Comment 7 mitz 2009-05-30 00:04:01 PDT
Created attachment 30802 [details]
Change paintFillLayerExtended() to use body's renderer as the StyleImage client when the background is propagated from body to root
Comment 8 Simon Fraser (smfr) 2009-05-30 08:44:06 PDT
Comment on attachment 30802 [details]
Change paintFillLayerExtended() to use body's renderer as the StyleImage client when the background is propagated from body to root

r=me
Comment 9 mitz 2009-05-30 10:58:04 PDT
Fixed in <http://trac.webkit.org/changeset/44285>.