<div class="gmail_quote">2009/7/16 Stefan Behnel <span dir="ltr">&lt;<a href="mailto:stefan_ml@behnel.de">stefan_ml@behnel.de</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


What? Why? I thought you used the Mozilla engine for displaying the XUL pages? </blockquote><div><br>Ahem. No. I am using the XUL -format- as a description of interfaces. But I&#39;m implementing my own layout engine in a completely different rendering framework (<a href="http:/www.panda3d.com">Panda3d</a>). Sorry if this wasn&#39;t clear from my previous messages.<br>

<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
&gt; When I add a composite GUI element to an interface (i.e. a new record in a<br>
&gt; table) it&#39;s easy enough to add it to the tree of objects in the GUI, but in<br>
&gt; terms of style I&#39;d need to find out which style information applies to it<br>
&gt; given the nature of the added element and its location in the tree. In a<br>
&gt; sense, rather than selecting the element given a (css) rule, I&#39;d need to<br>
&gt; select the applicable rules from the element and its position.<br>
<br>
</div>And that needs to be decided at runtime? Aren&#39;t there any general rules<br>
like &quot;when element X appears within the panel named Y, give it style Z&quot;?</blockquote><div><br>Not only. Some rules are applicable to an element even though they are specific to that element. I.e. &quot;.myClass&quot; applies to any element of class &quot;myClass&quot;. And that might not be that difficult to find. But there are some rules that specify that IF element Y has a child element X you should apply style Z (to Y, not X). To find those rules sounds a little harder.<br>

<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I doubt that you really have requirements that you cannot express<br>
statically (i.e. in advance) using CSS selectors. If you really need to<br>
distinguish identical elements depending on some logic in the XSLT driven<br>
document generation process, just give them different IDs and use those in<br>
the CSS file.</blockquote><div><br>Yes, true, I might be attempting to cover all cases programmatically when some sensible use of css/xslt might simplify the implementation.<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im">
</div>What I think you need to understand is the difference between the document<br>
status of an element (e.g. descendant of Z, child of X, @id=&quot;Y&quot;,<br>
@enabled=&quot;true&quot;) and the visual representation (visible, green, large,<br>
...). The mapping between those two is what CSS is designed for. And the<br>
CSS engine that sits right inside your XUL layout engine will do that<br>
mapping for you whenever either the document or the style information changes.</blockquote><div><br>Except, as I mentioned at the very beginning and is the crux of the discussion, I do not have a css engine nor a xul layout engine. I am making those more or less from scratch. <br>

<br>Manu<br></div></div><br>