Ticket #2528249 (closed defect)
ReporterTodd Kloots |
Opened: 09/17/09 Last modified: 09/29/09 Status: closed Type: defect Resolution: fixed |
Owner Satyen Desai |
Target Release: 3.0.0 GA Priority: P3 (normal) |
|---|---|---|---|
| Summary: | "type" attribute not available for Node instance augmented with Attribute | ||
| Description: | When a Node instance is augmented with Attribute, the "type" attribute returns "undefined" where prior to augmentation it returns the corresponding value of the raw DOM attribute. |
||
| Type: | defect | Observed in Version: | development master |
| Component: | Attribute | Severity: | S3 (normal) |
| Assigned To: | Satyen Desai | Target Release: | 3.0.0 GA |
| Location: | Library Code | Priority: | P3 (normal) |
| Tags: | Relates To: | ||
| Browsers: | N/A | ||
| URL: | |||
| Test Information: | |||
Change History
|
Posted: 09/17/09
|
|
Posted: 09/18/09
Commited. Attribute tests all pass. Smoke test on a couple of Anim, DD, Slider, Widget, Overlay examples looks fine. commit 78122fcb250c1bbadb9d6de392cbb0ef67d3898b Added internal configuration property (_bypassProxy) to allow Node to selectively define attributes it does not want to pass through transparently to the _stateProxy. Also changed logic which determines whether or not value is stored in _stateProxy if _stateProxy exists. Fixes #2528249 |
|
Posted: 09/18/09
Forgot to add. Attached test case also passes with the above fix in Safari. "type" retrieval still has the potential to fail in IE for "hidden" until Matt fixes #2528249. |
|
Posted: 09/18/09
Added internal configuration property (_bypassProxy) to allow Node to selectively define attributes it does not want to pass through transparently to the _stateProxy. Also changed logic which determines whether or not value is stored in _stateProxy if _stateProxy exists. Fixes #2528249 |
|
Posted: 09/29/09
|


Node sets up type as a managed ATTR...
Y.Node.ATTRS.type = {
setter: function(val) {
if (val === 'hidden') {
try {
this._node.type = 'hidden';
} catch(e) {
this._node.style.display = 'none';
}
}
return val;
}
};
However, since there's no getter, Attribute goes to "state" instead of "stateProxy" [ the node ] to get the attribute value, the (probably incorrect) assumption being if it's and attribute which as been added, the value is stored in state.
Will need to revisit the following conditional as a result:
_getStateVal : function(name) {
var stateProxy = this._stateProxy;
// If it's added, don't automatically assume the value is stored in state.
if (!stateProxy || this.attrAdded(name)) {
return this._state.get(name, VALUE);
} else {
return (stateProxy && stateProxy[name]);
}
},
Worth fixing for GA for the Node/Augmented with Attribute use case.