Closed
Bug 349441
Opened 19 years ago
Closed 19 years ago
HTMLInputElement['value'] inconsistent with HTMLInputElement.getAttributeNode('value').value
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
INVALID
People
(Reporter: free.leekai, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
2.54 KB,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060817 Minefield/3.0a1
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060817 Minefield/3.0a1
This happens in SeaMonkey, Minefield, et c.
I'm using only ECMAScript DOM bindings below.
As far as I can tell, for all other (HTMLElement[attrName.toLowerCase()], HTMLElement.getAttributeNode(attrName).value) pairs where both values exist, they are equal, and HTMLElement.setAttribute(attrName) and HTMLElement.removeAttribute(attrName) affect the HTMLElement[attrName.toLowerCase()] property unvaryingly.
However, for an HTMLInputElement (of type text for this discussion), if a value is assigned to HTMLInputElement['value'] (or HTMLInputElement.value) either by script =-assignment or by the user changing the value in the input field, the value Attr node becomes disconnected from the element's value property.
Run the test case to see where the two diverge. Reload it if you want to see another consequence.
Reproducible: Always
Steps to Reproduce:
run the test case
Actual Results:
if inputElement['value'] has ever been set by =-assignment or user input, inputElement.getAttribute('value') and inputElement['value'] may differ and get/set/removeAttribute('value') have no relationship to inputElement['value'] or the text rendered in the input field by the browser (which is strictly tied to inputElement['value']
Expected Results:
I'm not sure. After thinking about this for a long time, what happens may very well be what should happen.
The other possibility is that inputElement.getAttribute('value') and inputElement['value'] should always be the same, and get/set/removeAttribute('value') should be able to access the input field even after the user has inputed something.
I might even like the distinction between the property and the attribute value now though, although it is REALLY CONFUSING that there is a difference here but not in any HTMLElement besides HTMLInputElement. But I guess that's because it's an /input/ element.
Well, I guess I'll be somewhat happy if this gets marked INVALID by someone who really knows what ought to be going on here, but will submit it nevertheless to make sure that that someone who knows what really ought to be going on exists. I'm hardly qualified to decide what constitutes or does not constitute a bug on my own!
Reporter | ||
Comment 1•19 years ago
|
||
Reporter | ||
Comment 2•19 years ago
|
||
Attachment #234710 -
Attachment is obsolete: true
Comment 3•19 years ago
|
||
HTMLInputElement.value is the current value of the control. Set "value" content attributes maps to HTMLInputElement.defaultValue.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Updated•15 years ago
|
Assignee: general → nobody
Status: RESOLVED → VERIFIED
OS: Mac OS X → All
Hardware: PowerPC → All
You need to log in
before you can comment on or make changes to this bug.
Description
•