Closed Bug 1725293 Opened 4 months ago Closed 3 months ago

checkValidity() on <select required> returns true when <option value=""> is moved in the dom

Categories

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

Firefox 91
x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: oyejorge, Assigned: smaug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0

Steps to reproduce:

https://jsfiddle.net/qp4coed8/

<select required>.prepend( <option value=""> )

Actual results:

<select required>.checkValidity() returns true

Expected results:

<select required>.checkValidity() should return false

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Version: Firefox 90 → Firefox 91
Severity: -- → S3
Priority: -- → P3

The new check should be still fast, since accessing selected index is trivial and Item() call is just accessing the element from an
nsTArray.

Assignee: nobody → bugs
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/30148 for changes under testing/web-platform/tests
Status: UNCONFIRMED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.