[Webkit-unassigned] [Bug 276304] New: ::before ist more a piece of “::behind”

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jul 7 23:17:56 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=276304

            Bug ID: 276304
           Summary: ::before ist more a piece of “::behind”
           Product: WebKit
           Version: Safari 17
          Hardware: Unspecified
                OS: macOS 13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: stevestasteislost at icloud.com
                CC: bfulgham at webkit.org, simon.fraser at apple.com,
                    zalan at apple.com

Safari doesn’t render ::before as said by https://drafts.csswg.org/css-pseudo/#generated-content: “… as if they were immediate children of their originating element …”. The result is: some of the ::before content runs into the (not-)parents area. Just as if the “parent” was set to relative positioning with an margin left, the ::before positioned absolute, but the reserved space to the left of the “parent” isn’t calculated correctly (sometimes?).
I found this with this css:
:where(article, section, footer, [popover]) {
        max-block-size: 90vb;
        ul {
                display: inline flex;
                gap: 0 1ch;
                flex-flow: row wrap;
                margin: 0; padding: 0;
                list-style-type: none;
        }
        li {
                display: inline flex;
                position: relative;
        }
        li {
                &:not(:last-of-type)::after {
                        position: absolute;
                        left: 100%;
                        padding-inline: 0 1.5ch;
                        content: ",";
                }
                &[alt]::before {
                        content: attr(alt) ":";
                        display: block;
                        font-size: 50%;
                        font-stretch: condensed;
                }
        }
}
Result: the alt-attribute lays for approx. 2 characters behind it’s “parents” content.
This thing is handled correctly by Firefox. But that’s not an “1:0” for it, more likely an “63:64”.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240708/44e92952/attachment.htm>


More information about the webkit-unassigned mailing list