Skip to content

[css-content-3] content: none does not work as universally as the spec claims it does. #12998

@Psychpsyo

Description

@Psychpsyo

Currently, the none value of the content property says that:

On pseudo-elements it inhibits the creation of the pseudo-element as if it had display: none.

This is not respected universally in all three major browsers for all pseudo-elements. For example:

<!DOCTYPE html>
<style>
    dialog::backdrop {
        background-color: green;
        content: none;
    }
</style>
<dialog id="dialog"></dialog>
<script>
    dialog.showModal();
</script>

The green backdrop is visible in Firefox, Chrome and Safari.
I don't have time to test all the other pseudo-elements, but I'd assume that this is not just a problem with ::backdrop.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions