Bug 33091

Summary: SVGResources don't invalidate if target object changes attributes
Product: WebKit Reporter: Dirk Schulze <krit>
Component: SVGAssignee: Dirk Schulze <krit>
Status: RESOLVED FIXED    
Severity: Normal CC: eric, webkit.review.bot, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 19388    
Attachments:
Description Flags
SVGResources don't invalidate if object changes
none
Resource invalidation on attribute changes of target object zimmermann: review+

Description Dirk Schulze 2010-01-01 00:51:53 PST
Created attachment 45728 [details]
SVGResources don't invalidate if object changes

SVGResources don't invalidate if target object changes attributes. This is no problem on clipping, because we calculate the clipping path and clip the context on every call of SVGResourceClipper::applyClip. The same for filter. But we might change both to not recalculate the resource properties on every call of SVGResource*::apply*(). At least for filters that is highly ineffective and slows down the system a lot.
We also need to invalidate if a child changes it's properties. It will also affect clippers in the future, if we support more than simple pathes, like texts.

Another problem is the attribute visible. It looks like we still draw the childs of an element with the attribute visible="hidden". This can be a problem for filters, thus they can draw contents independent of it's target object. But this can be fixed with another bug report.

The attachement points the problem. Click on one of the rects or circles. The width of the element change from 200 to 100. You should see two circles (no ovals with different radiuses) and a quadrat with a shadow.
Comment 1 Dirk Schulze 2010-01-03 15:01:32 PST
Created attachment 45760 [details]
Resource invalidation on attribute changes of target object

Resource invalidation on attribute changes of target object.
Comment 2 WebKit Review Bot 2010-01-03 15:03:54 PST
style-queue ran check-webkit-style on attachment 45760 [details] without any errors.
Comment 3 Nikolas Zimmermann 2010-01-03 15:19:13 PST
Comment on attachment 45760 [details]
Resource invalidation on attribute changes of target object

Looks almost fine, please change following before landing:

> +void SVGStyledElement::invalidateResources()
> +{
Retrieve document via DOM, not render tree, and early exit when parsing:
Document* document = this->document();
if (!document->parsing())
    return;

You could also use "doc", and save the "this->", but I think it's a stylerule to not use abbreviations, if possible, so let's enforce it.

r=me.
Comment 4 Eric Seidel (no email) 2010-01-03 18:48:07 PST
Attachment 45760 [details] was posted by a committer and has review+, assigning to Dirk Schulze for commit.
Comment 5 Dirk Schulze 2010-01-04 00:58:01 PST
landed in r52709. Closing bug now.