Bug 89686 - Incorrect handling of chained pending resources in SVGUseElement
Summary: Incorrect handling of chained pending resources in SVGUseElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Florin Malita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-21 12:45 PDT by Florin Malita
Modified: 2012-07-12 05:26 PDT (History)
6 users (show)

See Also:


Attachments
The indirectly referenced resource is not rendered. (269 bytes, image/svg+xml)
2012-06-21 12:45 PDT, Florin Malita
no flags Details
Patch (15.95 KB, patch)
2012-07-11 14:28 PDT, Florin Malita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florin Malita 2012-06-21 12:45:32 PDT
Created attachment 148866 [details]
The indirectly referenced resource is not rendered.

SVGUseElement is currently building pending resources when the target is inserted into the tree, without checking first whether the target itself has any pending resources.

So depending on document order, chained <use>s can yield incomplete results.
Comment 1 Florin Malita 2012-07-11 14:19:22 PDT
The problematic case is <use> on <use>, when the target <use> has pending resources. The referencing element builds its shadow and instance trees when the target <use> becomes available, and the shadow tree expansion only captures a snapshot of the tree at that time. Later on, when the pending resources for the target element are resolved, the referencing <use> never refreshes its shadow tree.

To support arbitrary <use> on <use> constructs, we need some way to track these dependencies and update the referencing trees when the target trees get rebuilt. I have a patch that takes advantage of SVGDocumentExtensions' m_elementDependencies for this purpose.
Comment 2 Florin Malita 2012-07-11 14:28:41 PDT
Created attachment 151777 [details]
Patch
Comment 3 Nikolas Zimmermann 2012-07-12 00:54:05 PDT
Comment on attachment 151777 [details]
Patch

Beautiful! I'm happy that you've reused the elementDependencies set, it was meant as general solution to be adapted for <use>: great that you've tackled this! r=me.
Comment 4 WebKit Review Bot 2012-07-12 05:26:20 PDT
Comment on attachment 151777 [details]
Patch

Clearing flags on attachment: 151777

Committed r122449: <http://trac.webkit.org/changeset/122449>
Comment 5 WebKit Review Bot 2012-07-12 05:26:25 PDT
All reviewed patches have been landed.  Closing bug.