DOM Inspector doesn't show the value attribute of a text input node



Other Applications
DOM Inspector
6 years ago
6 years ago


(Reporter: mjh563, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



6 years ago
Created attachment 549756 [details]
DOM Inspector testcase.html

User Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110622232052

Steps to reproduce:

The attached testcase adds an input node to the DOM using Javascript and gives it a value. But when viewing that node in DOM Inspector, the value attribute is not shown.

Steps to reproduce:

1. View the testcase in Firefox.
2. Open DOM Inspector and select the INPUT node in the Document Viewer.
3. Select DOM node in the Object viewer.
4. Notice that the "value" attribute is not displayed (only the "type" is shown).

Change the testcase to set node.type to "hidden" instead of "text" and re-run the STR - now the value attribute is shown as expected.
The nice thing about DOM Inspector is that in this respect, for the time being, it shows exactly what exists in the DOM.  So if there were a bug at play here, we would know with a high degree of confidence that a bug should be filed against Gecko itself.

Programmatically poking at the element corroborates what's being shown; the attributes in the DOM Node viewer are the only attributes the element has.

DOM Level 2 says:
> When the type attribute of the element has the value "text", "file" or
> "password", this represents the current contents of the corresponding form
> control, in an interactive user agent. Changing this attribute changes the
> contents of the form control, but does not change the value of the HTML
> value attribute of the element. When the type attribute of the element has
> the value "button", "hidden", "submit", "reset", "image", "checkbox" or
> "radio", this represents the HTML value attribute of the element.

HTML5 looks to be incomplete here, but it has something similar, with its "value" mode and "default" mode <>, where "default" updates the value attribute and "value"... doesn't necessarily.  When the input type is "hidden", the mode is "default"; when the input type is "text", the mode is "value" <>.  (That table is non-normative, but I can't actually find the normative part of the spec that independently states anything resembling that mapping, so there you go.)

Thanks for the bug report.
Last Resolved: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.