Re: [svgwg] [svg-native] inner svg, symbol or use elements supported? (#671)

For one there is the issue with the forward declaration. Either you scan the document up-front for `id` attributes to have an ID - XML element map or you add a placeholder and revisit `use` later but need to keeps its "rendering tree" in memory.

Then there is the general "as if the use gets replaced by a group and a copy of the referenced element added as child of that group"-behavior which requires the same referenced element to be part of different document sub-trees. So you can not resolve the style of that element on its first appearance. As a matter of fact, any element that has an `id` is a potentially referenced element and the style inheritance tree ("render tree") changes when it gets referenced.

A use-element referenced element can have a clipping path (CSS property) that clipping path (element) may have a child which references our use element. So the cycle detection code does not simply need to check the element referencing (use-element directly or indirectly via more use-elements references itself) but also needs to check the resolved style. IMO that is a major hold up on implementing `<use>` since that would cause an stack overflow.

-- 
GitHub Notification of comment by dirkschulze
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/671#issuecomment-484769368 using your GitHub account

Received on Friday, 19 April 2019 05:09:28 UTC