Bug 89686

Summary: Incorrect handling of chained pending resources in SVGUseElement
Product: WebKit Reporter: Florin Malita <fmalita>
Component: SVGAssignee: Florin Malita <fmalita>
Status: RESOLVED FIXED    
Severity: Normal CC: krit, pdr, rakuco, rwlbuis, webkit.review.bot, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
The indirectly referenced resource is not rendered.
none
Patch none

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.