<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>281277</bug_id>
          
          <creation_ts>2024-10-10 20:39:30 -0700</creation_ts>
          <short_desc>css counter value is not incremented while adding textContent into the DOM</short_desc>
          <delta_ts>2024-10-15 05:55:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>https://codepen.io/ffoodd/pen/bGXBaMM</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>m_dubet</cc>
    
    <cc>rik</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>webkit.jiion</cc>
    
    <cc>xavier</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2067112</commentid>
    <comment_count>0</comment_count>
      <attachid>472901</attachid>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-10-10 20:39:30 -0700</bug_when>
    <thetext>Created attachment 472901
testcase

1. With Safari
2. Open the testcase or https://codepen.io/ffoodd/pen/bGXBaMM
3. Look at the body

Expected:
The `test` string is every second.
and the counter is incremented by 1.

Safari:
* test string is added
* counter stays at 0

Firefox/Chrome
* test string is added
* counter is incremented by one at every iteration.



The counter is defined by

```
body { counter-reset: test; }

span { counter-increment: test; }

body::after {
    content: counter(test);
    display: block;
}
```


and the string is added by 


```
setInterval(() =&gt; {
  const t = document.createElement(&apos;span&apos;);
  t.textContent = &apos;test&apos;;
  document.body.append(t);
}, 1000);
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067113</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-10-10 20:39:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/137726892&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2067114</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2024-10-10 20:42:02 -0700</bug_when>
    <thetext>This bug was reported by Gaël Poupard on 
https://mastodon.cloud/@ffoodd@mamot.fr/113283173919966650</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>472901</attachid>
            <date>2024-10-10 20:39:30 -0700</date>
            <delta_ts>2024-10-10 20:39:30 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>testcase.html</filename>
            <type>text/html</type>
            <size>766</size>
            <attacher name="Karl Dubost">karlcow</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KCjxoZWFkPgogICAgPG1ldGEgY2hhcnNl
dD0iVVRGLTgiPgogICAgPG1ldGEgbmFtZT0idmlld3BvcnQiCiAgICAgICAgICBjb250ZW50PSJ3
aWR0aD1kZXZpY2Utd2lkdGgsIGluaXRpYWwtc2NhbGU9MS4wIj4KICAgIDx0aXRsZT5DU1MgY291
bnRlciBpbmNyZW1lbnQgdGVzdCBvbiBib2R5LmFwcGVuZDwvdGl0bGU+CiAgICA8c3R5bGU+CiAg
ICAgICAgYm9keSB7CiAgICAgICAgICAgIGNvdW50ZXItcmVzZXQ6IHRlc3Q7CiAgICAgICAgfQoK
ICAgICAgICBzcGFuIHsKICAgICAgICAgICAgY291bnRlci1pbmNyZW1lbnQ6IHRlc3Q7CiAgICAg
ICAgfQoKICAgICAgICBib2R5OjphZnRlciB7CiAgICAgICAgICAgIGNvbnRlbnQ6IGNvdW50ZXIo
dGVzdCk7CiAgICAgICAgICAgIGRpc3BsYXk6IGJsb2NrOwogICAgICAgIH0KICAgIDwvc3R5bGU+
Cgo8L2hlYWQ+Cgo8Ym9keT4KICAgIDxwPjxhIGhyZWY9Imh0dHBzOi8vY29kZXBlbi5pby9mZm9v
ZGQvcGVuL2JHWEJhTU0iPnRlc3QgYnkgR2HDq2wgUG91cGFyZDwvYT48L3A+CiAgICA8c2NyaXB0
PnNldEludGVydmFsKCgpID0+IHsKICAgICAgICAgICAgY29uc3QgdCA9IGRvY3VtZW50LmNyZWF0
ZUVsZW1lbnQoJ3NwYW4nKTsKICAgICAgICAgICAgdC50ZXh0Q29udGVudCA9ICd0ZXN0JzsKICAg
ICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmQodCk7CiAgICAgICAgfSwgMTAwMCk7CiAgICA8
L3NjcmlwdD4KPC9ib2R5PgoKPC9odG1sPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>