Closed Bug 721234 Opened 14 years ago Closed 13 years ago

textual inputs do not get a value attribute assigned in the markup of the page if it is omitted

Categories

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

9 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bryn, Unassigned)

Details

Attachments

(1 file)

Attached file val_broke.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7 Steps to reproduce: When creating an <input type=text />, if the value attribute is not set the browser leaves it omitted and does not correct the HTML. The value is present somewhere in the DOM, however, as it can still be read from Javascript. Even when there is a value input into the text box, the attribute is left out of the rendered source. Sample HTML attached. The example uses jQuery to illustrate the issue easily, but the missing attribute can be seen with other tools such as firebug as well. Actual results: The first input, without a value attribute, should have the attribute added when the HMTL is parsed, corrected and rendered. It does not, even when a value is typed into the field. (tested with version 9.01 which reports itself as "Up to date") Expected results: Both evaluations of $(element).is( '[value]' ) should return true.
Attachment #591627 - Attachment mime type: text/plain → text/html
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
Why would a "value" _attribute_ be added? No browser does that, and it would be totally unexpected to do it. There's nothing "incorrect" about having an <input> with no "value" attribute, so there is nothing to correct.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: