Re: proposed element() CSS function

Robert O'Callahan wrote:
> I've updated my proposal:
> http://people.mozilla.com/~roc/SVG-CSS-Effects-Draft.html
> with a rough outline of an "element()" CSS function that would overcome 
> some of the limitations of the CSS url() syntax.
> 
> Let me summarize the motivation:
> 
> We need a flexible way to reference subtrees of DOM documents. The CSS 
> url() syntax is inadequate for the following reasons:
> 
>     * url() values are relative to the CSS stylesheet so there is no way
>       for an external stylesheet to reliably reference an element in the
>       styled document.
>     * An external url() reference refers to a "resource document" with a
>       given URI. There is no way to reference an element in a
>       subdocument of the styled document, such as a specific IFRAME. In
>       general we may want to follow a path of subdocument references and
>       external resource document references.
>     * The SVG WG has already begun defining semantics for url()s with
>       fragment references, which make it clear the referenced fragment
>       must be interpreted in the context of the whole document. When we
>       reference SVG paint servers from non-SVG content, we need to
>       interpret the subtrees as isolated fragments. 
> 

I use selector() function in cases when one element needs reference to 
another. For example:

input[type="scrollbar"]
{
   -context-menu: selector( menu#for-scrollbar );
}

Needless to say that selectors give you
various addressing schemas:

button[type="popup-menu"]
{
   -menu: selector( head > menu:nth-child(2) );
}

My 2 cents.

-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Tuesday, 15 July 2008 06:56:03 UTC