Skip to content

CSS editor incorrectly flags dot notation in ::host() and ::slotted() pseudo-elements as syntax error #8784

@davinunesdasilva

Description

@davinunesdasilva

Apache NetBeans version

Apache NetBeans 27

What happened

The NetBeans CSS editor incorrectly identifies the dot (.) in class selectors within ::host() and ::slotted() pseudo-elements as a syntax error. The editor shows error indicators for valid CSS syntax that is part of the Shadow DOM specification.

Language / Project Type / NetBeans Component

No response

How to reproduce

  • Open or create a CSS file in NetBeans
  • Write CSS rules using class selectors within Shadow DOM pseudo-elements:
    ::host(.active) {
    background-color: blue;
    }

::slotted(.highlight) {
color: red;
}

::host(.disabled) {
opacity: 0.5;
}

  • Observe that the editor shows syntax errors specifically at the dot (.) character

Did this work correctly in an earlier version?

No / Don't know

Operating System

Linux mint

JDK

openjdk 21

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

Technical Context:

::host(.class) targets the host element when it has the specified class
::slotted(.class) targets slotted elements with the specified class
Both are standard CSS Shadow DOM selectors supported by all modern browsers
The dot notation is the standard CSS class selector syntax

Reference:

CSS Scoping Module specification: https://www.w3.org/TR/css-scoping-1/
MDN ::host(): https://developer.mozilla.org/en-US/docs/Web/CSS/::host_function
MDN ::slotted(): https://developer.mozilla.org/en-US/docs/Web/CSS/::slotted

Impact:

False positive error reporting
Disrupts Web Component development workflow
Confuses developers working with modern CSS features

Are you willing to submit a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    CSS[ci] enable web jobkind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions