Closed Bug 1878608 Opened 2 years ago Closed 2 years ago

:has()-Selector in combination with ::after-element does not work correctly

Categories

(Core :: CSS Parsing and Computation, defect)

Firefox 123
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: tobergte, Unassigned, NeedInfo)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:123.0) Gecko/20100101 Firefox/123.0

Steps to reproduce:

I have used the :has()-Selector in combination with an ::after-pseudo-element e.g. ".classname:has(.class)::after"

Actual results:

This produces the bug, that if the class inside the has-selector is not set, you still get the pseudo-element without any styles.

Expected results:

The pseudo-element should not be placed insite the DOM

Summary: :has()-Selector in combination with ::after-element e.g. ".classname:has(.class)::after" does not work correctly → :has()-Selector in combination with ::after-element does not work correctly
Blocks: has-issues
Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

Can you attach a test-case? Without it it's hard to investigate. My guess is that this is bug 1876962

Flags: needinfo?(tobergte)
See Also: → 1876962

Reporter: just a reminder, please attach a testcase (rather than a screenshot of some styles) so we can take a look here. Thanks!

Alternately, if it's easier than producing a sharable testcase/URL: could you test Firefox Nightly ( https://nightly.mozilla.org/ ) and see if you can reproduce the bug there with whatever site you're hitting this issue on? Current Nightly includes the fix for the bug that emilio mentioned -- so if his hunch is correct, then hopefully you'll see this issue fixed in Nightly.

@tobergte - sorry for just adding on here. I did try to create a simplified test case based on your description and screenshot, but it seems to work fine even in currently Firefox stable v122 - https://codepen.io/scheinercc/pen/xxBMEmy
Feel free to clone the Pen and change to replicate the issue you experienced.

Closing as "incomplete" since a month has passed since the request-for-testcase; we can't proceed without that.

Please reopen if you can provide a testcase or a link to a demo that reproduces the issue. Thanks! (In the meantime, we can hope that emilio's theory in comment 1 was correct and this was a version of bug 1876962.)

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: