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

Re: [css-gcpm] String-set issues

From: Liam R E Quin <liam@w3.org>
Date: Wed, 26 Nov 2014 02:43:55 -0500
To: Brad Kemper <brad.kemper@gmail.com>
Cc: www-style list <www-style@w3.org>
Message-ID: <20141126024355.5ef048c4.liam@w3.org>
On Tue, 25 Nov 2014 22:01:55 -0800
Brad Kemper <brad.kemper@gmail.com> wrote:

> Another thing is I think there is too much of a tendency to go to functional notation in CSS, which is not as easy to read as simple name:value declarations. I really don't want to see functions inside of other functions, and it sounds like functions might really be needed for date and number formatting. So, I'd prefer we avoided functions here for content pulls.

I think we already have that attr(), and we'll see more with combinations of format-number and calc.

The problems are more complex and harder to describe, so that a more complex notation isn't a surprise. Most people won't need to do arithmetic on page numbers, but when people do, it should be obvious how to do it.
> If we did go with functional notation, I think I'd almost prefer to get rid of the indirection altogether, and have a real selector as an argument of the function, like Liam and I touched on. That would make your example look like this:
> @page:left {
>  @top-left {
>    content: copy-from("h1:first-of-page");
>    }
> }

I think that sort of idea is becoming very common these days with the success of jQuery.

> But that could get cumbersome too:


> content: "Chapter " copy-from("h1:first-of-page", counter(chapter) ": " contents ", " formatDate(attr(date), "MM/DD/YYYY"));

Yes - although you have your nested function calls :-). This is similar to one of the ways to do this in XSLT + XSL-FO; the other is closer to your flow example. Sometimes one is better and sometimes the other. I don't like having to invent names for things that don't have problem-domain-level significance if it can be avoided.

Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Received on Wednesday, 26 November 2014 07:50:53 UTC

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