W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2019

Re: [csswg-drafts] [css-content-3] target-text can create a loop (#4610)

From: Mike Bremford via GitHub <sysbot+gh@w3.org>
Date: Tue, 17 Dec 2019 17:31:15 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-566666497-1576603874-sysbot+gh@w3.org>
That's correct, yes. It is defined as that, and implemented this way in at least AH Formatter, RealObjects PDFReactor and I believe also "paged.js" - although as the definitions of these functions have been hopping about from css-content, css-gcpm and css-lists for the last few years it's a bit difficult to keep track.

The second parameter to target-text is defined in css-content as "... using the same values as the string-set property..." - which is defined in gcpm: https://drafts.csswg.org/css-gcpm/#funcdef-content

> before = The string value of the ::before pseudo-element, determined as if white-space: normal had been set.

To lift an examples from that spec demonstrating `string-set`:
h1::before { content: 'Chapter ' counter(chapter); }
h1 { string-set: header content(before) ':' content(text); }
h1::after { content: '.'; }

The value of the named string “header” will be “Chapter 1: Loomings”.

GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4610#issuecomment-566666497 using your GitHub account
Received on Tuesday, 17 December 2019 17:31:17 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:57 UTC