NEW 94292
:first-letter breaks counters and quotes
https://bugs.webkit.org/show_bug.cgi?id=94292
Summary :first-letter breaks counters and quotes
Elliott Sprehn
Reported 2012-08-16 22:02:06 PDT
Created attachment 158992 [details] Quote Reduction Adding :first-letter to a CSS element with quotes will break the nesting because the RenderQuote gets removed from the render tree, split into two RenderText's and then destroyed. This is particularly unfortunate because it means we call originalText() on detached RenderQuote so open-quote is always depth = 0, and close-quote is always empty string. Worse yet, because the RenderQuote itself was destroyed the depth of all other quotes in the document becomes busted. This looks really hard to fix without completely redesigning first-letter or how we handle generated content.
Attachments
Quote Reduction (178 bytes, text/html)
2012-08-16 22:02 PDT, Elliott Sprehn
no flags
Counter Reduction (548 bytes, text/html)
2012-08-16 22:46 PDT, Elliott Sprehn
no flags
Elliott Sprehn
Comment 1 2012-08-16 22:20:27 PDT
The issue discussed here also destroys RenderCounter's, and the only reason dynamic counters still work after this is because we have a separate CounterNode tree. RenderQuote has no separate list so destruction of a renderer breaks everything. This also breaks the Internals API valueForCounter (see writeCounterValuesFromChildren) since the RenderCounter is destroyed when the text is split.
Eric Seidel (no email)
Comment 2 2012-08-16 22:31:15 PDT
Oh :first-letter, how we love thee. We can chat about this in person next week.
Elliott Sprehn
Comment 3 2012-08-16 22:46:07 PDT
Created attachment 159003 [details] Counter Reduction Because we destroy the RenderCounter any changes to the counter values (ex. adding or removing a counter-reset or counter-increment) doesn't get reflected in the other counters in the document. Note: Inserting at the end of a counter scope appears to work, but that's just coincidence because of the separate CounterNode tree.
Elliott Sprehn
Comment 4 2012-08-16 22:47:19 PDT
(In reply to comment #1) > The issue discussed here also destroys RenderCounter's, and the only reason dynamic counters still work after this is because we have a separate CounterNode tree. I was wrong about this. :first-letter breaks everything :( @eseidel Sounds good.
Ryosuke Niwa
Comment 5 2012-08-16 22:55:20 PDT
I believe I'm of some use here :)
Ahmad Saleem
Comment 6 2022-08-30 02:02:50 PDT
I able not able to reproduce this bug using "Quote" reduction and all browser (Safari 15.6.1, Firefox Nightly 107 and Chrome Canary 107) show it same. While in case of Counter Reduction, it just keep on showing "1" and does not increment like Firefox Nightly 107 do and it shows 1,2,3,4,5.. While both Safari and Chrome are just 1,1,1,1,1,. Just wanted to share updated testing results. Thanks!
Ryosuke Niwa
Comment 7 2022-08-30 06:40:31 PDT
This bug still exists.
Ahmad Saleem
Comment 8 2022-08-30 09:22:16 PDT
(In reply to Ryosuke Niwa from comment #7) > This bug still exists. Hi Ryosuke, just for my learning, can you show or explain me on how to reproduce this bug in "Quote Reduction", so I don't miss it in future. Thanks in advance!
Ryosuke Niwa
Comment 9 2022-08-30 09:33:15 PDT
(In reply to Ahmad Saleem from comment #8) > (In reply to Ryosuke Niwa from comment #7) > > This bug still exists. > > Hi Ryosuke, just for my learning, can you show or explain me on how to > reproduce this bug in "Quote Reduction", so I don't miss it in future. > Thanks in advance! The issue is that number is not increasing from 1. In Firefox, number will keep increasing as you mentioned above. So this bug still exists in Blink and WebKit.
Note You need to log in before you can comment on or make changes to this bug.