NEW 210474
[Interop 2021][css-flexbox] Incorrect computed style for first-letter pseudo-element
https://bugs.webkit.org/show_bug.cgi?id=210474
Summary [Interop 2021][css-flexbox] Incorrect computed style for first-letter pseudo-...
Carlos Alberto Lopez Perez
Reported 2020-04-13 20:29:56 PDT
The spec <https://drafts.csswg.org/css-flexbox-1/#placement> says that the flexbox placement should not apply to the ::first-letter pseudo-content Now, consider this test: <style> div { display: flex; } div::first-letter { order: 2 } </style> <div>Triceratops</div> WebKit renders it correctly because the first letter element (T) gets rendered ignoring the "order: 2" style value. However, once you examine the computed style for the element, then that seems wrong as it appears with a computed value of "2" for "order". This causes failures on WPT test http://wpt.live/css/css-flexbox/flexbox_first-letter.html
Attachments
Radar WebKit Bug Importer
Comment 1 2022-05-31 10:55:47 PDT
Tim Nguyen (:ntim)
Comment 2 2022-08-15 21:24:39 PDT
This is quite straightforward to fix: https://searchfox.org/wubkat/rev/30ec4a7da2ed391580b109cbae2595e4b04652b3/Source/WebCore/rendering/updating/RenderTreeBuilderFirstLetter.cpp#42 `firstLetterStyle.setOrder(RenderStyle::initialOrder());`
Tim Nguyen (:ntim)
Comment 3 2022-08-15 21:25:08 PDT
Just not sure if there's anything other ::first-letter needs this adjustment (::first-line maybe?)
Tim Nguyen (:ntim)
Comment 4 2022-09-17 08:07:19 PDT
Looks like to edit the computed style, we need to change a bit earlier on: https://searchfox.org/wubkat/rev/88494bd8279fc758940dcabe84dc7c79e6a1231b/Source/WebCore/style/StyleResolver.cpp#438 The other function I linked for the used computed style actually clones the style, so it doesn't make it into the computed style.
Tim Nguyen (:ntim)
Comment 5 2022-09-17 08:08:05 PDT
The only approach I can really think of here is a blocklist/allowlist of properties.
Note You need to log in before you can comment on or make changes to this bug.