Open Bug 1910571 Opened 1 year ago Updated 1 year ago

Form-Associated custom element - css pseudo element user-valid/user-invalid set wrongfully when ElementInternals.setValidity is called

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 130
defect

Tracking

()

UNCONFIRMED

People

(Reporter: matthias, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file demo.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0

Steps to reproduce:

Calling ElementInternals.setValidity() on a FACE will apply the :user-valid/:user-invalid css pseudo element.

Actual results:

:user-valid/:user-invalid gets set

Expected results:

:user-valid/:user-invalid should not be set when updating the validity of the FACE

The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

I think this is basically undefined, right? See https://github.com/whatwg/html/issues/9639

Component: CSS Parsing and Computation → DOM: Core & HTML

Right. Now that i thinking about it I don't know what I should expect.

Initially I expected it to not set anything (never appear as user-interacted) as I would solve the lack of a proper api with a data attribute mimicking the behavior.

So acting as user-invalid is an issue in my case as it's styled before i want/need it to. But considering one might only style errors via user-invlid it's a reasonable default to reflect the current validity state until there is a spec for it. Better to display an invalid state too early then not at all.

Yeah fwiw that was my reasoning when implementing this.

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: