WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
268597
Counters and :before interaction with parent element with display:none
https://bugs.webkit.org/show_bug.cgi?id=268597
Summary
Counters and :before interaction with parent element with display:none
Karl Dubost
Reported
2024-02-01 18:38:26 PST
Created
attachment 469669
[details]
testcase 1. Load the test case 2. Click on More Expected: Number 20 is displayed as - [20] - Actual: Number 17 is displayed as - [17] - Both Firefox and Chrome display - [20] - after the click.
Attachments
testcase
(3.13 KB, text/html)
2024-02-01 18:38 PST
,
Karl Dubost
no flags
Details
rendering in safari, firefox, chrome after the click
(481.58 KB, image/png)
2024-02-01 18:38 PST
,
Karl Dubost
no flags
Details
web inspector
(58.41 KB, image/png)
2024-02-04 21:01 PST
,
Karl Dubost
no flags
Details
testcase reduced, but not working
(1.96 KB, text/html)
2024-02-04 21:05 PST
,
Karl Dubost
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Karl Dubost
Comment 1
2024-02-01 18:38:59 PST
Created
attachment 469670
[details]
rendering in safari, firefox, chrome after the click
Radar WebKit Bug Importer
Comment 2
2024-02-01 18:39:21 PST
<
rdar://problem/122150415
>
Karl Dubost
Comment 3
2024-02-04 16:52:31 PST
There is a shorter version there
https://jsfiddle.net/Rolf_b/axjvuo5y/
But it is still a bit hard to understand what is happening. It would be great to be able to reduce the testcase to its absolute minimum, so that the WebKit engineers can clearly easily isolate what is happening.
Karl Dubost
Comment 4
2024-02-04 18:13:25 PST
ok. The testcase shows two cases (in fact 4 cases with more/less): The big purple number counts ALL the visible li elements. My first column is the li element count. Then the list structure with nested li/ul/li elements. 1 * A1 2 * A2 3 * A3 4 * A3.1 5 * A3.2 (hidden with display:none) 6 * A4 7 * A4.1 8 * A4.2 (hidden with display:none) 9 * A4.3 So we can see in the HTML, there are 9 li elements. The total count changes if and only if `::before` is used on all li elements to show the index on each li element. In Safari: ========== When all elements are shown (no us of display:none), the total count of li elements is: * 7 without ::before to display counter on each li element * 9 with ::before When some elements are hidden (aka two li hidden in the tests): the total count of li element is * 7 without ::before * 7 with ::before In Firefox/Chrome: ================== When all elements are shown (no us of display:none), the total count of li elements is: * 9 without ::before to display counter on each li element * 9 with ::before When some elements are hidden (aka two li hidden in the tests): the total count of li element is * 7 without ::before * 7 with ::before Safari doesn't count the li elements which start a nested list, textnode or not. (adding text nodes help to understand a bit more the test).
Karl Dubost
Comment 5
2024-02-04 21:01:17 PST
Created
attachment 469720
[details]
web inspector hmm I wonder if it's in fact an issue with nested parsing. See the attachment
Karl Dubost
Comment 6
2024-02-04 21:05:39 PST
Created
attachment 469721
[details]
testcase reduced, but not working That Said I have not been able to reproduce it yet. even with a more simplified test case.
Karl Dubost
Comment 7
2024-02-04 21:06:46 PST
Adding Matthieu just in case.
Ahmad Saleem
Comment 8
2024-02-05 15:17:10 PST
Might be something here:
https://searchfox.org/wubkat/rev/5266b069f715d2051da7f1fc8def26d5dcd5e03c/Source/WebCore/rendering/RenderCounter.cpp#497
stevestasteislost
Comment 9
2024-02-08 14:46:06 PST
Safari got an update, the bug grew! Now ::after doesn’t count any more (in the code, where I found this thing).
https://developer.apple.com/forums/thread/745708
stevestasteislost
Comment 10
2024-02-08 15:39:47 PST
Well, not only Safari … After first having an eye on „my“ bug in Safari, I thought “something else”? And: yes: FireFox doesn’t count too! No hint inside its inspector. But with a closer look I found: FireFox doesn’t apply the ::after to the li-elment. The ::after appears in it’s inspector after the included a. Instead of <li class…> <a …>…</a> </li> ::after … it shows up as <li class…> <a …>…</a> ::after … </li> Well, this isn’t the place where the stylesheet says “count” …
stevestasteislost
Comment 11
2024-02-21 18:46:07 PST
Latest update for Safari (und Preview) didn’t change the “broken ::after”. Just one thing happened: both, Safari and Firefox (updated too) don’t count any more in my case! All ::after show “1”. But only Safari shows an error(!?!) for the related CSS.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug