Bug 33091 - SVGResources don't invalidate if target object changes attributes
Summary: SVGResources don't invalidate if target object changes attributes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Dirk Schulze
URL:
Keywords:
Depends on:
Blocks: 19388
  Show dependency treegraph
 
Reported: 2010-01-01 00:51 PST by Dirk Schulze
Modified: 2010-01-04 00:58 PST (History)
3 users (show)

See Also:


Attachments
SVGResources don't invalidate if object changes (1.42 KB, image/svg+xml)
2010-01-01 00:51 PST, Dirk Schulze
no flags Details
Resource invalidation on attribute changes of target object (33.94 KB, patch)
2010-01-03 15:01 PST, Dirk Schulze
zimmermann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.