W3C home > Mailing lists > Public > www-style@w3.org > July 2008

Re: proposed element() CSS function

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Mon, 14 Jul 2008 23:55:17 -0700
Message-ID: <487C49D5.8020004@terrainformatica.com>
To: robert@ocallahan.org
CC: "www-style@w3.org" <www-style@w3.org>, www-svg <www-svg@w3.org>

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:55:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:10 GMT