# DOM interfaces to CSS generated content/counters

From: Manuel Strehl <manuel.strehl@sprachlit.uni-regensburg.de>
Date: Fri, 16 Apr 2010 13:04:12 +0200

Message-Id: <1271415852.3730.25.camel@phy311.cip.uni-regensburg.de>
Hello,

my apologies, if this topic is either relevant for the CSS mailing list

I noticed, that there seems to be no possibility to access the current
CSS counter value or the generated content of a (pseudo-) element via
Javascript. With possibility I mean, that there seem to be no interfaces
defined at all. After asking a question on this topic at StackOverflow
[1] it seems, that I not just overlooked something.

Has this topic been discussed before? (My searches on W3C mailing lists
didn't bring any result.) Are there plans for extending the DOM Style
recommendation in this direction?

A note on possible use cases: Think of cross references inside documents
using CSS counters. If a heading has a generated counter, one could
include this value in another text node to mark the connection to this
header. That would be analogous to LaTeX's \label and \ref usage and
would allow content providers to deliver flexible markup without
hard-coded counters.

While it is possible to determine the value of the 'content' property
via getComputedStyle() and re-calculate counters by looping through all
preceding nodes, these values have already been evaluated by the browser
at DOM load time and it would be both performance enhancing and easily
usable for developers, if the final computed generated content could be
accessed via the DOM.

Cheers,
Manuel

[1] http://stackoverflow.com/questions/2651739

Received on Sunday, 18 April 2010 21:38:48 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:16 UTC