RESOLVED FIXED 242798
Inline element with a block ::before following a floated element is cleared
https://bugs.webkit.org/show_bug.cgi?id=242798
Summary Inline element with a block ::before following a floated element is cleared
Erik Bročko
Reported 2022-07-15 07:50:39 PDT
Created attachment 460925 [details] Floated block followed by an inline element. Elements with `float: right` followed by an inline container (set to `clear: both`) with ::before pseudo-element set to `display: block` inside it make the inline element truly cleared. If `clear: both` is omitted, all works fine. If there is no `::before` block pseudoelement, it works fine. (Works fine = consistently with other browsers and previously observed behavior.) Chrome, Firefox and Safari Technology Preview 142 render it the same way, with content immediately after the floated element wrapping around it. Safari Technology Preview 147+ and Safari 16.0 force the element to be cleared. See my attached example. I think this is because the ::before block pseudo-element gets put outside its parent inline element. I'm not sure if this is necessarily a bug. I couldn't test other versions of Safari, as they're impossible to download...
Attachments
Floated block followed by an inline element. (958 bytes, text/html)
2022-07-15 07:50 PDT, Erik Bročko
no flags
Patch (3.96 KB, patch)
2022-08-02 18:44 PDT, alan
no flags
Radar WebKit Bug Importer
Comment 1 2022-07-22 07:51:14 PDT
alan
Comment 2 2022-08-02 14:01:16 PDT
> I think this is because the ::before block pseudo-element gets put outside > its parent inline element. I'm not sure if this is necessarily a bug. I > couldn't test other versions of Safari, as they're impossible to download... Thank you for the test reduction. I think 'clear' confuses our inline layout and inflates the formatting context root's height. Looking into it now.
alan
Comment 3 2022-08-02 18:44:46 PDT
EWS
Comment 4 2022-08-03 08:34:43 PDT
Committed 253076@main (2c461c54b9fa): <https://commits.webkit.org/253076@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 461368 [details].
Note You need to log in before you can comment on or make changes to this bug.