WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
41596
Pattern fill with image not rendered after reload
https://bugs.webkit.org/show_bug.cgi?id=41596
Summary
Pattern fill with image not rendered after reload
Tony Sung
Reported
2010-07-05 02:40:29 PDT
Steps to reproduce: 1. Empty cache 2. Open the attachment in WebKit 3. Observe the image being rendered 4. Reload Expected result: 1. An image is rendered Actual result: 1. Nothing is rendered
Attachments
Test case
(637 bytes, application/xhtml+xml)
2010-07-05 02:41 PDT
,
Tony Sung
no flags
Details
Testcase that tiles
(513 bytes, image/svg+xml)
2010-08-06 22:48 PDT
,
Nikolas Zimmermann
no flags
Details
Patch
(57.88 KB, patch)
2010-08-07 00:46 PDT
,
Nikolas Zimmermann
no flags
Details
Formatted Diff
Diff
Patch v2
(57.01 KB, patch)
2010-08-07 00:57 PDT
,
Nikolas Zimmermann
dbates
: review+
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Tony Sung
Comment 1
2010-07-05 02:41:25 PDT
Created
attachment 60508
[details]
Test case
Simon Fraser (smfr)
Comment 2
2010-07-07 11:11:26 PDT
<
rdar://problem/8159531
>
Simon Fraser (smfr)
Comment 3
2010-08-06 16:32:43 PDT
***
Bug 43654
has been marked as a duplicate of this bug. ***
Simon Fraser (smfr)
Comment 4
2010-08-06 16:33:32 PDT
The pattern is rendered into an ImageBuffer in RenderSVGResourcePattern::createTileImage(), by calling SVGRenderSupport::renderSubtreeToImage() with the RenderSVGImage. If this happens too early, there's no image yet, but there's also nothing to update the pattern once the image finally loads.
Nikolas Zimmermann
Comment 5
2010-08-06 22:34:02 PDT
(In reply to
comment #4
)
> The pattern is rendered into an ImageBuffer in RenderSVGResourcePattern::createTileImage(), by calling SVGRenderSupport::renderSubtreeToImage() with the RenderSVGImage. If this happens too early, there's no image yet, but there's also nothing to update the pattern once the image finally loads.
There is, RenderSVGImage::imageChanged, contains following code to handle it: // The image resource defaults to nullImage until the resource arrives. // This empty image may be cached by SVG resources which must be invalidated. if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this)) resources->invalidateClient(this); Not sure what is happening, will check the testcase soon.
Nikolas Zimmermann
Comment 6
2010-08-06 22:48:19 PDT
Created
attachment 63807
[details]
Testcase that tiles Same testcase as SVG only file, with a pattern that actually tiles.
Nikolas Zimmermann
Comment 7
2010-08-06 23:06:37 PDT
(In reply to
comment #5
)
> (In reply to
comment #4
) > > The pattern is rendered into an ImageBuffer in RenderSVGResourcePattern::createTileImage(), by calling SVGRenderSupport::renderSubtreeToImage() with the RenderSVGImage. If this happens too early, there's no image yet, but there's also nothing to update the pattern once the image finally loads. > > There is, RenderSVGImage::imageChanged, contains following code to handle it: > > // The image resource defaults to nullImage until the resource arrives. > // This empty image may be cached by SVG resources which must be invalidated. > if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this)) > resources->invalidateClient(this); > > Not sure what is happening, will check the testcase soon.
Ah I see, how stupid. The code above looks up resources defined on the _image_ itself. eg. <image clip-path="..." and would notify the clip-path, that it has to recalculate. But if the <image> itself lives in a resources, that one is not updated. should be an easy fix.
Nikolas Zimmermann
Comment 8
2010-08-07 00:46:15 PDT
Created
attachment 63809
[details]
Patch Bug was very easy to fix, creating a testcase was not that trivial. I've chosen to create a http test, that utilizes a perl script to slowly load an image (1s delay, as used for the mask image test). Have a look :-)
Nikolas Zimmermann
Comment 9
2010-08-07 00:57:52 PDT
Created
attachment 63810
[details]
Patch v2 First patch contained a wrong version of the test, uncommented and with a delay of 2s.
Daniel Bates
Comment 10
2010-08-07 01:01:55 PDT
Comment on
attachment 63810
[details]
Patch v2
> Index: WebCore/ChangeLog > =================================================================== > --- WebCore/ChangeLog (revision 64899) > +++ WebCore/ChangeLog (working copy) > @@ -1,3 +1,18 @@ > +2010-08-07 Nikolas Zimmermann <
nzimmermann@rim.com
> > + > + Reviewed by NOBODY (OOPS!). > + > + Pattern fill with image not rendered after reload > +
https://bugs.webkit.org/show_bug.cgi?id=41596
> + > + Fixed by a one-liner. Instead of just invalidating it's own resources, images also have to update
Nit: "it's" should be "its".
> + resources in the ancestor chain, if imageChanged() has been called (for example, a slow loading image) > + > + Test: http/tests/misc/slow-loading-image-in-pattern.html
Looks good to me. r=me.
Nikolas Zimmermann
Comment 11
2010-08-07 02:26:28 PDT
Landed in
r64901
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug