1) had to be contained within the element,
2) had to be in a namespace with a different prefix than the dominant namespace - i.e.,
3) you worked with wrapper methods that were sensitive to that prefix.
<svg ...>
<g id="stuff">
<ex:star cx="100" cy="100" numpoints="5" r="100" r2="50">
<!-- This is the shadow tree for the ex:star element -->
<ge:g xmlns:ge="http://www.w3.org/2000/svg">
<ge:path d="..."/>
</ge:g>
</ex:star>
</g>
<script>
// my script
</script>
</svg>
It'd not be perfect, and we're beginning to stray away from either the Mozilla or W3C XBL implementations, but I think you could do something if you were consistent.
It's late, and i'm not thinking clearly, so let me noodle more on this, but I think there may be a way to provide even better encapsulation.
-- Kurt
On 4/20/06, Cameron McCormack <cam@...> wrote:
Kurt Cagle:
> Not completely sure about that. I do agree that it would probably be
> fairly inefficient, but I'm not sure that a Javascript shadow tree
> arrangement would be out of the realm of possibility. Been thinking
> about implementing something like that for IE anyway, so I can start
> developing cross platform bindings without getting locked in JS
> spaghetti code.
I don't think it would be that inefficient, but there'd be the issue of
having things like:
<svg ...>
<g id="stuff">
<ex:star cx="100" cy="100" numpoints="5" r="100" r2="50"/>
<g>
<!-- This is the shadow tree for the previous ex:star element -->
<path d="..."/>
</g>
</g>
<script>
for (var n = document.getElementById("stuff"); n;
n = n.nextSibling) {
if (n.nodeType == Node.ELEMENT_NODE) {
// do something with every element child of "stuff"
}
}
</script>
</svg>
where you might trip over the 'g' element that is effectively the shadow
tree of the ex:star element.
--Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org
YAHOO! GROUPS LINKS
- Visit your group "xbl-developers" on the web.
- To unsubscribe from this group, send an email to:
xbl-developers-unsubscribe@yahoogroups.com
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service .
--
Kurt Cagle
http://www.understandingxml.com