Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Statistics are no substitute for judgement. -- Henry Clay


devel / comp.lang.javascript / Re: Get ::before value

SubjectAuthor
* Get ::before valueAndrew Poulos
+* Re: Get ::before valueJulio Di Egidio
|`* Re: Get ::before valueAndrew Poulos
| `* Re: Get ::before valueAndrew Poulos
|  `* Re: Get ::before valueJulio Di Egidio
|   `- Re: Get ::before valueJulio Di Egidio
`* Re: Get ::before valueMichael Haufe (TNO)
 `* Re: Get ::before valueJulio Di Egidio
  `* Re: Get ::before valueMichael Haufe (TNO)
   `- Re: Get ::before valueJulio Di Egidio

1
Get ::before value

<n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17183&group=comp.lang.javascript#17183

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 16 Jul 2021 02:52:56 -0500
Newsgroups: comp.lang.javascript
X-Mozilla-News-Host: news://news.iinet.net.au:119
From: ap_prog@hotmail.com (Andrew Poulos)
Subject: Get ::before value
Date: Fri, 16 Jul 2021 17:52:54 +1000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-AU
Content-Transfer-Encoding: 7bit
Message-ID: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
Lines: 18
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 203.219.145.102
X-Trace: sv3-ZW4AjdEgvIq7pMrATxd2+C0Q0Y3YvS9TSgysHS3V6A5CBAzvnjMKE0OUSagKdsej5kDOnLHYvd0h2yh!NQwXH015GtXHvWD5Kb/3SabbQ+k7vtRZf/PsMP8eXtVY4gxGLm5g7bSxViwhxgv1/82hrBjyYauO!HAo0+y2uZwr5JzZIsWH+bM8=
X-Complaints-To: abuse@westnet.com.au
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1581
 by: Andrew Poulos - Fri, 16 Jul 2021 07:52 UTC

Some content gets generated by CSS and I need to get the "live" value.

The element in question has this CSS

::before {
counter-increment: num;
content: counter(num) ". ";
}

I tried
getComputedStyle(elem, '::before').getPropertyValue('content');
and it returns
counter(num) ". "
and not the "live" value I was expecting (hoping).

How can I get the actual text that is displayed?

Andrew Poulos

Re: Get ::before value

<17405ccd-9c4a-4762-aed7-cf4de539129an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17184&group=comp.lang.javascript#17184

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:620a:4004:: with SMTP id h4mr10225792qko.370.1626446585491; Fri, 16 Jul 2021 07:43:05 -0700 (PDT)
X-Received: by 2002:aca:35c5:: with SMTP id c188mr8058206oia.154.1626446585252; Fri, 16 Jul 2021 07:43:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Fri, 16 Jul 2021 07:43:04 -0700 (PDT)
In-Reply-To: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.98.6; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.98.6
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <17405ccd-9c4a-4762-aed7-cf4de539129an@googlegroups.com>
Subject: Re: Get ::before value
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Fri, 16 Jul 2021 14:43:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 29
 by: Julio Di Egidio - Fri, 16 Jul 2021 14:43 UTC

On Friday, 16 July 2021 at 09:53:08 UTC+2, Andrew Poulos wrote:
> Some content gets generated by CSS and I need to get the "live" value.
>
> The element in question has this CSS
>
> ::before {
> counter-increment: num;
> content: counter(num) ". ";
> }
>
> I tried
> getComputedStyle(elem, '::before').getPropertyValue('content');
> and it returns
> counter(num) ". "
> and not the "live" value I was expecting (hoping).
>
> How can I get the actual text that is displayed?

As far as I can tell, there is no way to access that value. Indeed, you cannot even select the generated text (I mean, not even with your mouse).

See also here: <https://stackoverflow.com/questions/532073/how-can-i-read-the-applied-css-counter-value>

The obvious work-around is to generate the numbering from JS, i.e. just do not use that CSS: or do, but then be prepared to compute the same on the scripting side some other way, and make also sure that who writes the CSS talks to who writes the JS and vice versa...

Julio

Re: Get ::before value

<y_WdnTVyZKGNjm_9nZ2dnUU7-R3NnZ2d@westnet.com.au>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17185&group=comp.lang.javascript#17185

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 16 Jul 2021 18:15:28 -0500
Subject: Re: Get ::before value
Newsgroups: comp.lang.javascript
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
<17405ccd-9c4a-4762-aed7-cf4de539129an@googlegroups.com>
From: ap_prog@hotmail.com (Andrew Poulos)
Date: Sat, 17 Jul 2021 09:15:27 +1000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
MIME-Version: 1.0
In-Reply-To: <17405ccd-9c4a-4762-aed7-cf4de539129an@googlegroups.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-AU
Content-Transfer-Encoding: 7bit
Message-ID: <y_WdnTVyZKGNjm_9nZ2dnUU7-R3NnZ2d@westnet.com.au>
Lines: 33
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 203.219.145.102
X-Trace: sv3-oyyi99oLlfGlDpX8IJKNKXfQ4zwqiXFTC+z06kYmm9ptFPOtXfSo+ogzCdQNzJk+MiSv7fWqIrvfc1D!9GJMIVH+/vbK6PfOLMME9i/kzK3Z20pNMqqe3EqakaezDwiSTSy9h0WQAO8ynN7Yasx8IKSWQ/8e!O3Jxrg8YNlFQ3h/owjRjjVo=
X-Complaints-To: abuse@westnet.com.au
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2540
 by: Andrew Poulos - Fri, 16 Jul 2021 23:15 UTC

On 17/07/2021 12:43 am, Julio Di Egidio wrote:
> On Friday, 16 July 2021 at 09:53:08 UTC+2, Andrew Poulos wrote:
>> Some content gets generated by CSS and I need to get the "live" value.
>>
>> The element in question has this CSS
>>
>> ::before {
>> counter-increment: num;
>> content: counter(num) ". ";
>> }
>>
>> I tried
>> getComputedStyle(elem, '::before').getPropertyValue('content');
>> and it returns
>> counter(num) ". "
>> and not the "live" value I was expecting (hoping).
>>
>> How can I get the actual text that is displayed?
>
> As far as I can tell, there is no way to access that value. Indeed, you cannot even select the generated text (I mean, not even with your mouse).
>
> See also here: <https://stackoverflow.com/questions/532073/how-can-i-read-the-applied-css-counter-value>

Thanks for link.

> The obvious work-around is to generate the numbering from JS, i.e. just do not use that CSS: or do, but then be prepared to compute the same on the scripting side some other way, and make also sure that who writes the CSS talks to who writes the JS and vice versa...

Funny that the browser knows what text to display but I will need to
script some workaround to get it.

Andrew Poulos

Re: Get ::before value

<IvGdnWxpTZOFqW_9nZ2dnUU7-efNnZ2d@westnet.com.au>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17186&group=comp.lang.javascript#17186

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 16 Jul 2021 20:36:23 -0500
Subject: Re: Get ::before value
Newsgroups: comp.lang.javascript
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
<17405ccd-9c4a-4762-aed7-cf4de539129an@googlegroups.com>
<y_WdnTVyZKGNjm_9nZ2dnUU7-R3NnZ2d@westnet.com.au>
From: ap_prog@hotmail.com (Andrew Poulos)
Date: Sat, 17 Jul 2021 11:36:22 +1000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
MIME-Version: 1.0
In-Reply-To: <y_WdnTVyZKGNjm_9nZ2dnUU7-R3NnZ2d@westnet.com.au>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-AU
Content-Transfer-Encoding: 8bit
Message-ID: <IvGdnWxpTZOFqW_9nZ2dnUU7-efNnZ2d@westnet.com.au>
Lines: 43
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 203.219.145.102
X-Trace: sv3-aNCBPzTRlXpuqBHTcIq/Dm3jTlH05yuV8Kh1O4V7o2q/2BtSlzBXamntIIxCotvTC7CV2xv0RHwDZkF!MVllx9TMEoqDJ0KQPoJkTgnf0kdfnX0GniTAgZSw3AKMhnYpQ4kAGmyMdpdmudf35KSrvUbSwgTs!TutMTGdeEwnL/Ome1bGgRks=
X-Complaints-To: abuse@westnet.com.au
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2839
 by: Andrew Poulos - Sat, 17 Jul 2021 01:36 UTC

On 17/07/2021 9:15 am, Andrew Poulos wrote:
> On 17/07/2021 12:43 am, Julio Di Egidio wrote:
>> On Friday, 16 July 2021 at 09:53:08 UTC+2, Andrew Poulos wrote:
>>> Some content gets generated by CSS and I need to get the "live" value.
>>>
>>> The element in question has this CSS
>>>
>>> ::before {
>>> counter-increment: num;
>>> content: counter(num) ". ";
>>> }
>>>
>>> I tried
>>> getComputedStyle(elem, '::before').getPropertyValue('content');
>>> and it returns
>>> counter(num) ". "
>>> and not the "live" value I was expecting (hoping).
>>>
>>> How can I get the actual text that is displayed?
>>
>> As far as I can tell, there is no way to access that value.  Indeed,
>> you cannot even select the generated text (I mean, not even with your
>> mouse).
>>
>> See also here:
>> <https://stackoverflow.com/questions/532073/how-can-i-read-the-applied-css-counter-value>
>>
>
> Thanks for link.
>
>> The obvious work-around is to generate the numbering from JS, i.e.
>> just do not use that CSS: or do, but then be prepared to compute the
>> same on the scripting side some other way, and make also sure that who
>> writes the CSS talks to who writes the JS and vice versa...
>
> Funny that the browser knows what text to display but I will need to
> script some workaround to get it.

I guess it's something similar with the "numbers" for ordered list items
in that you can't query what a browser is actually displaying.

Andrew Poulos

Re: Get ::before value

<8c78d50a-e35f-4bc2-bbd5-aafd0dca209fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17187&group=comp.lang.javascript#17187

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:ad4:5ccc:: with SMTP id iu12mr14191335qvb.21.1626524998592;
Sat, 17 Jul 2021 05:29:58 -0700 (PDT)
X-Received: by 2002:a4a:6042:: with SMTP id t2mr2834021oof.31.1626524998364;
Sat, 17 Jul 2021 05:29:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Sat, 17 Jul 2021 05:29:58 -0700 (PDT)
In-Reply-To: <IvGdnWxpTZOFqW_9nZ2dnUU7-efNnZ2d@westnet.com.au>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.101.66; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.101.66
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
<17405ccd-9c4a-4762-aed7-cf4de539129an@googlegroups.com> <y_WdnTVyZKGNjm_9nZ2dnUU7-R3NnZ2d@westnet.com.au>
<IvGdnWxpTZOFqW_9nZ2dnUU7-efNnZ2d@westnet.com.au>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8c78d50a-e35f-4bc2-bbd5-aafd0dca209fn@googlegroups.com>
Subject: Re: Get ::before value
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Sat, 17 Jul 2021 12:29:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Julio Di Egidio - Sat, 17 Jul 2021 12:29 UTC

On Saturday, 17 July 2021 at 03:36:36 UTC+2, Andrew Poulos wrote:
> On 17/07/2021 9:15 am, Andrew Poulos wrote:
> > On 17/07/2021 12:43 am, Julio Di Egidio wrote:
> >> On Friday, 16 July 2021 at 09:53:08 UTC+2, Andrew Poulos wrote:
> >>> Some content gets generated by CSS and I need to get the "live" value..
> >>>
> >>> The element in question has this CSS
> >>>
> >>> ::before {
> >>> counter-increment: num;
> >>> content: counter(num) ". ";
> >>> }
> >>>
> >>> I tried
> >>> getComputedStyle(elem, '::before').getPropertyValue('content');
> >>> and it returns
> >>> counter(num) ". "
> >>> and not the "live" value I was expecting (hoping).
> >>>
> >>> How can I get the actual text that is displayed?
> >>
> >> As far as I can tell, there is no way to access that value. Indeed,
> >> you cannot even select the generated text (I mean, not even with your
> >> mouse).
> >>
> >> See also here:
> >> <https://stackoverflow.com/questions/532073/how-can-i-read-the-applied-css-counter-value>
> >
> > Thanks for link.
> >
> >> The obvious work-around is to generate the numbering from JS, i.e.
> >> just do not use that CSS: or do, but then be prepared to compute the
> >> same on the scripting side some other way, and make also sure that who
> >> writes the CSS talks to who writes the JS and vice versa...
> >
> > Funny that the browser knows what text to display but I will need to
> > script some workaround to get it.
>
> I guess it's something similar with the "numbers" for ordered list items
> in that you can't query what a browser is actually displaying.

Right. I suppose it has to do with how the browser is structured, anyway the docs (MDN) are quite explicit (though it's a bit all over the place), that it's stuff that doesn't make it to the DOM nor to the "accessibility tree", e.g. see here: <https://developer.mozilla.org/en-US/docs/Web/CSS/content#accessibility_concerns> In particular, I take that to mean that not even a screen reader would see that part.

I think the bottom line is to use these features only as lightweight "graphic effects", when e.g. the numbering is not significant, just decorative. Similarly for CSS animations and other effects: if e.g. sequencing or synchronisation is a requirement, CSS is just not the way to go. Indeed, the fact that some of this stuff doesn't even make it to the DOM nor to accessibility tree to me is signal that it shouldn't be used at all, unless it really does not matter.

Anyway, my 2c.

Julio

Re: Get ::before value

<b6e2d095-aa1d-4e4f-bd51-cef4b0d3c430n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17190&group=comp.lang.javascript#17190

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:622a:1105:: with SMTP id e5mr18872937qty.268.1626622041974;
Sun, 18 Jul 2021 08:27:21 -0700 (PDT)
X-Received: by 2002:aca:4288:: with SMTP id p130mr15243520oia.80.1626622041726;
Sun, 18 Jul 2021 08:27:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Sun, 18 Jul 2021 08:27:21 -0700 (PDT)
In-Reply-To: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
Injection-Info: google-groups.googlegroups.com; posting-host=75.87.218.49; posting-account=hYRygAoAAABkmvJVmPilz9Q1TOjgPQAq
NNTP-Posting-Host: 75.87.218.49
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b6e2d095-aa1d-4e4f-bd51-cef4b0d3c430n@googlegroups.com>
Subject: Re: Get ::before value
From: tno@thenewobjective.com (Michael Haufe (TNO))
Injection-Date: Sun, 18 Jul 2021 15:27:21 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Michael Haufe (TNO) - Sun, 18 Jul 2021 15:27 UTC

On Friday, July 16, 2021 at 2:53:08 AM UTC-5, Andrew Poulos wrote:
> Some content gets generated by CSS and I need to get the "live" value.
>
> The element in question has this CSS
>
> ::before {
> counter-increment: num;
> content: counter(num) ". ";
> }
>
> I tried
> getComputedStyle(elem, '::before').getPropertyValue('content');
> and it returns
> counter(num) ". "
> and not the "live" value I was expecting (hoping).
>
> How can I get the actual text that is displayed?

This is not possible currently. There are hacks that might work but with the complexity involved it's probably better to do this with JavaScript.

There is a new CSS standard in the works `target-counter()` to make this possible in the future:

<https://github.com/w3c/csswg-drafts/issues/5879>

Re: Get ::before value

<db1af9fb-9614-481f-8eca-e344efc8c0cbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17191&group=comp.lang.javascript#17191

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:622a:209:: with SMTP id b9mr18724350qtx.136.1626779213736; Tue, 20 Jul 2021 04:06:53 -0700 (PDT)
X-Received: by 2002:a4a:a6c2:: with SMTP id i2mr14486214oom.92.1626779213501; Tue, 20 Jul 2021 04:06:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Tue, 20 Jul 2021 04:06:53 -0700 (PDT)
In-Reply-To: <b6e2d095-aa1d-4e4f-bd51-cef4b0d3c430n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.99.126; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.99.126
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au> <b6e2d095-aa1d-4e4f-bd51-cef4b0d3c430n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <db1af9fb-9614-481f-8eca-e344efc8c0cbn@googlegroups.com>
Subject: Re: Get ::before value
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Tue, 20 Jul 2021 11:06:53 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 30
 by: Julio Di Egidio - Tue, 20 Jul 2021 11:06 UTC

On Sunday, 18 July 2021 at 17:27:26 UTC+2, Michael Haufe (TNO) wrote:
> On Friday, July 16, 2021 at 2:53:08 AM UTC-5, Andrew Poulos wrote:
> > Some content gets generated by CSS and I need to get the "live" value.
> >
> > The element in question has this CSS
> >
> > ::before {
> > counter-increment: num;
> > content: counter(num) ". ";
> > }
> >
> > I tried
> > getComputedStyle(elem, '::before').getPropertyValue('content');
> > and it returns
> > counter(num) ". "
> > and not the "live" value I was expecting (hoping).
> >
> > How can I get the actual text that is displayed?
>
> This is not possible currently. There are hacks that might work
> but with the complexity involved it's probably better to do this with JavaScript.

There are no hacks, there is just no access from JS to the runtime value of those properties.

> There is a new CSS standard in the works `target-counter()` to make this possible in the future:
>
> <https://github.com/w3c/csswg-drafts/issues/5879>

"The target-counter() function does exactly this in CSS, not JS", i.e. same as above.

Julio

Re: Get ::before value

<2ffa7eb0-f50a-411b-8af9-9e6e9d306c3an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17192&group=comp.lang.javascript#17192

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a37:d8c:: with SMTP id 134mr30330654qkn.433.1626793886361;
Tue, 20 Jul 2021 08:11:26 -0700 (PDT)
X-Received: by 2002:a9d:5c7:: with SMTP id 65mr22988878otd.360.1626793886057;
Tue, 20 Jul 2021 08:11:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Tue, 20 Jul 2021 08:11:25 -0700 (PDT)
In-Reply-To: <db1af9fb-9614-481f-8eca-e344efc8c0cbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:63e1:1820:4907:9971:5936:3cc2;
posting-account=hYRygAoAAABkmvJVmPilz9Q1TOjgPQAq
NNTP-Posting-Host: 2600:1700:63e1:1820:4907:9971:5936:3cc2
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au>
<b6e2d095-aa1d-4e4f-bd51-cef4b0d3c430n@googlegroups.com> <db1af9fb-9614-481f-8eca-e344efc8c0cbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2ffa7eb0-f50a-411b-8af9-9e6e9d306c3an@googlegroups.com>
Subject: Re: Get ::before value
From: tno@thenewobjective.com (Michael Haufe (TNO))
Injection-Date: Tue, 20 Jul 2021 15:11:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Michael Haufe (TNO) - Tue, 20 Jul 2021 15:11 UTC

On Tuesday, July 20, 2021 at 6:06:58 AM UTC-5, ju...@diegidio.name wrote:
> On Sunday, 18 July 2021 at 17:27:26 UTC+2, Michael Haufe (TNO) wrote:

> > This is not possible currently. There are hacks that might work
> > but with the complexity involved it's probably better to do this with JavaScript.

> There are no hacks, there is just no access from JS to the runtime value of those properties.

You misinterpret what I was referring to with 'this'. I am fully aware that the runtime value is not available.

> > There is a new CSS standard in the works `target-counter()` to make this possible in the future:
> >
> > <https://github.com/w3c/csswg-drafts/issues/5879>
> "The target-counter() function does exactly this in CSS, not JS", i.e. same as above.

The difference being that this value could be accessible from the CSSOM, therefore not the same as above. As mentioned in that same thread there is a browser flag available that one could use to confirm: `--enable-blink-features=CSSAtRuleCounterStyle`, but I don't care enough to try.

Re: Get ::before value

<0eb2e704-c964-4089-a159-fb6cb9361ba0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17193&group=comp.lang.javascript#17193

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a05:622a:1105:: with SMTP id e5mr31945161qty.268.1626876842577; Wed, 21 Jul 2021 07:14:02 -0700 (PDT)
X-Received: by 2002:a9d:6059:: with SMTP id v25mr16832536otj.204.1626876842317; Wed, 21 Jul 2021 07:14:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Wed, 21 Jul 2021 07:14:02 -0700 (PDT)
In-Reply-To: <8c78d50a-e35f-4bc2-bbd5-aafd0dca209fn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.98.166; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.98.166
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au> <17405ccd-9c4a-4762-aed7-cf4de539129an@googlegroups.com> <y_WdnTVyZKGNjm_9nZ2dnUU7-R3NnZ2d@westnet.com.au> <IvGdnWxpTZOFqW_9nZ2dnUU7-efNnZ2d@westnet.com.au> <8c78d50a-e35f-4bc2-bbd5-aafd0dca209fn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0eb2e704-c964-4089-a159-fb6cb9361ba0n@googlegroups.com>
Subject: Re: Get ::before value
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Wed, 21 Jul 2021 14:14:02 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 10
 by: Julio Di Egidio - Wed, 21 Jul 2021 14:14 UTC

On Saturday, 17 July 2021 at 14:30:03 UTC+2, Julio Di Egidio wrote:
> On Saturday, 17 July 2021 at 03:36:36 UTC+2, Andrew Poulos wrote:
<snip>
> > I guess it's something similar with the "numbers" for ordered list items
> > in that you can't query what a browser is actually displaying.
>
> Right. I suppose it has to do with how the browser is structured,

<https://developer.mozilla.org/en-US/docs/Web/Performance/How_browsers_work>

Julio

Re: Get ::before value

<755cd825-9651-4a3f-9995-861e900cd056n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17194&group=comp.lang.javascript#17194

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a0c:eed1:: with SMTP id h17mr36261180qvs.58.1626877749878; Wed, 21 Jul 2021 07:29:09 -0700 (PDT)
X-Received: by 2002:a05:6830:242f:: with SMTP id k15mr27219006ots.72.1626877749615; Wed, 21 Jul 2021 07:29:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Wed, 21 Jul 2021 07:29:09 -0700 (PDT)
In-Reply-To: <2ffa7eb0-f50a-411b-8af9-9e6e9d306c3an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.41.98.166; posting-account=F3H0JAgAAADcYVukktnHx7hFG5stjWse
NNTP-Posting-Host: 93.41.98.166
References: <n4OdnddWv_ZFp2z9nZ2dnUU7-QPNnZ2d@westnet.com.au> <b6e2d095-aa1d-4e4f-bd51-cef4b0d3c430n@googlegroups.com> <db1af9fb-9614-481f-8eca-e344efc8c0cbn@googlegroups.com> <2ffa7eb0-f50a-411b-8af9-9e6e9d306c3an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <755cd825-9651-4a3f-9995-861e900cd056n@googlegroups.com>
Subject: Re: Get ::before value
From: julio@diegidio.name (Julio Di Egidio)
Injection-Date: Wed, 21 Jul 2021 14:29:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 27
 by: Julio Di Egidio - Wed, 21 Jul 2021 14:29 UTC

On Tuesday, 20 July 2021 at 17:11:31 UTC+2, Michael Haufe (TNO) wrote:
> On Tuesday, July 20, 2021 at 6:06:58 AM UTC-5, ju...@diegidio.name wrote:
> > On Sunday, 18 July 2021 at 17:27:26 UTC+2, Michael Haufe (TNO) wrote:
<snip>
> > > There is a new CSS standard in the works `target-counter()` to make this possible in the future:
> > >
> > > <https://github.com/w3c/csswg-drafts/issues/5879>
> >
> > "The target-counter() function does exactly this in CSS, not JS", i.e. same as above.
>
> The difference being that this value could be accessible from the CSSOM,

You just guessing? I see no trace that such thing is in the workings. And, even if eventually it will (if you start asking for it...), it wouldn't just be for one isolated property: indeed, see my link on how a browser works, the point being that a modification like scripted access to the rendered value of the above properties means changing the browser' pipeline. But then of course that simply boils down to collapsing some layers, and we are back to square one: that those CSS features should rather and only be used for... etc. etc.

Anyway, my 2c... (EOD.)

Julio


devel / comp.lang.javascript / Re: Get ::before value

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor