Ticket #302 (new defect)

Opened 4 months ago

MochiKit.DOM.updateNodeAttributes() doesn't correctly update 'value' property

Reported by: cederberg@gmail.com Assigned to: somebody
Priority: normal Milestone: MochiKit 1.4
Component: component1 Version:
Severity: normal Keywords:
Cc:

Description

Perhaps this is not really a defect, but rather a some unexpected behaviour from the real world of DOM inconsistencies. But setting the 'value' of an element with MochiKit.DOM.updateNodeAttributes() doesn't always work as expected:

See 'Notes' in MDC for setAttribute()

In the error case that I've just got, I'm using the following call:

MochiKit.DOM.updateNodeAttribute(node, { value: ";,\t" });

But then node.value only becomes ";," in Firefox due to some bug/undocumented feature that apparently trims the attribute value. Setting the 'value' the old-fashioned way works correctly though:

node.value = ";,\t";

As indicated in the MDC Notes above, perhaps this special exception should be coded into MochiKit.DOM.updateNodeAttributes since it is what people would expect. Or we just document it properly in the documentation.