Open Bug 1887122 Opened 2 months ago Updated 9 days ago

HTML input field's required attribute gets reinterpreted

Categories

(Core :: DOM: Forms, defect)

Firefox 122
defect

Tracking

()

UNCONFIRMED

People

(Reporter: github, Unassigned, NeedInfo)

Details

Attachments

(1 file)

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

Steps to reproduce:

Write a simple HTML code that has at least one input field with required attribute.
The required attribute is A BOOLEAN one, so it should NOT be reinterpreted by the browser as an attribute that should have a textual value.
But Firefox DOES reinterpret it, doesn't make the input required, and if you look at the source of the page, you can see that the required attribute is reinterpreted as required="" . This is wrong, boolean attributes don't have text values

Actual results:

Created an html submit form, with an input field with a required attribute.
Firefox reinterprets this attribute, and considers it a text value, and hence, doesn't make the input REQUIRED.

Expected results:

Upon trying to submit a form with an empty input field that has a REQUIRED attribute, an error message should have been displayed, and form submission should not have been possible.

Reporter, can you please attach a html test file that can easily reproduce the issue. Thank you.

Flags: needinfo?(github)

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

Component: Untriaged → DOM: Forms
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: