W3C home > Mailing lists > Public > www-style@w3.org > June 2014

Re: Cross Referencing Between Elements

From: Brian Blakely <anewpage.media@gmail.com>
Date: Wed, 11 Jun 2014 15:36:27 -0400
Message-ID: <CAJGQg4Hak_dtSuUYWsHG-4SVf896NHxuTM+2=RZL8=xiLQn8gg@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "www-style@w3.org" <www-style@w3.org>
Yes, there are a couple issues with recursion.

Cross-reference selectors can be provided (and so, create recursion) in 2

1) As the selector argument.

2) In the fallback argument, as the selector of a nested cross-reference.

Recursion Issue 1

In an instance where the cross-reference ends up selecting the element
being defined, that should result in an invalid selector, leading to the
fallback value.  If no fallback was supplied, the result is an invalid

Recursion Issue 2

A fallback can actually consist of another cross-reference.  This falls
prey to two recursion-related issues of its own:

1) The cross-reference in the fallback may select the element being defined.

If a cross-reference given as the value of another cross-reference's
fallback argument selects the element being defined, the entire value is
considered invalid.

2) Arbitrarily deep cross-reference nesting.

A cross-reference given as the value of another cross-reference's fallback
argument may not be supplied a cross-reference in its own fallback argument
(any other kind of value is still valid).  Without this restriction, it
becomes possible to nest arbitrarily deep, and I can't think of a good
use-case that warrants this behavior.

The maximum fallback chain looks like: Cross-Ref => Cross-Ref => Value.
 This provides a lot of utility while maintaining sanity.

On Wed, Jun 11, 2014 at 2:41 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 6/11/14, 2:34 PM, Brian Blakely wrote:
>> Error Handling
> This section needs to at least define the behavior of:
> .foo {
>   width: calc( $(.foo width 90vw) - 200px );
> }
> as well as more complicated variants thereof.
> -Boris
Received on Wednesday, 11 June 2014 19:37:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:43 UTC