Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#7355 closed defect (fixed)

dojo.attr() cannot retrieve value="" attributes on form elements in IE 6

Reported by: paulprince Owned by: Eugene Lazutkin
Priority: high Milestone: 1.4
Component: HTML Version: 1.1.1
Keywords: Cc: paul@…
Blocked By: Blocking:

Description

Returns null value instead.

Retrieving other attributes seems to work.

Not sure in what other situations this bug might be triggered.

phiggins tested against trunk... attaching his modifications to my test case.

Attachments (1)

dojobreak.html (924 bytes) - added by paulprince 11 years ago.
phiggins'-provided simple test case

Download all attachments as: .zip

Change History (13)

Changed 11 years ago by paulprince

Attachment: dojobreak.html added

phiggins'-provided simple test case

comment:1 Changed 11 years ago by dylan

Milestone: tbdfuture

comment:2 Changed 11 years ago by dylan

Milestone: future1.2
Owner: changed from anonymous to dylan
Status: newassigned

comment:3 Changed 11 years ago by bill

FYI I assume this is why CheckBox?.js has the code:

if(this.value == ""){
	this.value = "on";
}

(because the parser is reporting that the user has specified a value initialization parameter when really they haven't)

comment:4 Changed 11 years ago by david

The problem seems to be with the IE's getAttributeNode. When you ask it for the attribute node value, the specified property is set to false (which is wrong because value is set to a non-default value). It gets called from hasAttr which gets called by attr on line 1254:

return (typeof attrValue == 'boolean' || typeof attrValue == 'function') ? attrValue
   : (d.hasAttr(node, name) ? node.getAttribute(name) : null);

I don't know if it is necessary to call d.hasAttr(...) in this case. Is there some advantage over changing it to:

return (typeof attrValue == 'boolean' || typeof attrValue == 'function') ? attrValue
   : node.getAttribute(name);

Please advise.

comment:5 Changed 11 years ago by bill

Milestone: 1.21.3

as per today's meeting, punting these core bugs

comment:6 Changed 11 years ago by dylan

Milestone: 1.3future

I haven't had time to tackle this one... no obvious solution in my eyes, so marking as future unless there are objections.

comment:7 Changed 11 years ago by dylan

Owner: changed from dylan to Eugene Lazutkin
Status: assignednew

comment:8 Changed 11 years ago by Eugene Lazutkin

Status: newassigned

comment:9 Changed 11 years ago by Eugene Lazutkin

Component: CoreHTML

comment:10 Changed 10 years ago by Eugene Lazutkin

Related to #8991.

comment:11 Changed 10 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [17931]) html: cleaning dojo.attr() according to James' suggestions (thx, James Burke!), removing the "whitelist" of attributes, adding a test for "value", updating tests to account for non-standard IE6/7 behavior, !strict, fixes #8991, fixes #7355.

comment:12 Changed 10 years ago by Adam Peller

Milestone: future1.4
Note: See TracTickets for help on using tickets.