Bug 15645

Summary: WebKit fails to render <use> example in SVG 1.1 spec
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: SVGAssignee: Nikolas Zimmermann <zimmermann>
Status: RESOLVED FIXED    
Severity: Normal CC: zimmermann
Priority: P2 Keywords: NeedsReduction
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
URL: http://www.w3.org/TR/SVG/images/struct/Use04.svg
Attachments:
Description Flags
Initial patch hyatt: review+

Description Eric Seidel (no email) 2007-10-23 16:53:21 PDT
WebKit fails to render <use> example in SVG 1.1 spec

http://www.w3.org/TR/SVG/images/struct/Use04.svg
is the file

http://www.w3.org/TR/SVG/struct.html#UseElement
explains the file

I haven't looked at why we fail yet.
Comment 1 Nikolas Zimmermann 2007-11-25 05:09:43 PST
Removing rule 8, makes it work as expected:

      /* rule 8 */ g > path { visibility: hidden }

Investigating soon.
Comment 2 Nikolas Zimmermann 2007-11-25 05:15:57 PST
Ok, found the culprit:
<path> is referenced by the <use> element. In our generated tree the <path> will be a direct child element of <g> (which replaces the <use> in the generated tree). Though the spec cleary states:

Rules 7 and 8: CSS selectors only apply to the formal document tree, not on the generated tree; thus, these selectors will not yield a match.

We need to support this. (while reminding ourselves that class & id selectors etc. still need to work within the generated subtree)
Comment 3 Nikolas Zimmermann 2007-12-02 17:00:31 PST
Created attachment 17657 [details]
Initial patch
Comment 4 Eric Seidel (no email) 2007-12-02 21:48:48 PST
Comment on attachment 17657 [details]
Initial patch

This needs to include landing the test case.  I think this is otherwise right, but hyatt really should have a look.
Comment 5 Dave Hyatt 2007-12-02 21:50:04 PST
Comment on attachment 17657 [details]
Initial patch

r=me
Comment 6 Nikolas Zimmermann 2007-12-03 10:58:54 PST
Landed in r28357.