Failing tests and fix for writeAttribute #81

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@victor-homyakov

Failing unit tests for ticket 1431 https://prototype.lighthouseapp.com/projects/8886/tickets/1431-writeattributechecked-fails-to-write-the-checked-attribute-write-an-undefined-attribute-instead
writeAttribute('checked') and writeAttribute('style') create additional attribute with name undefined

@savetheclocktower savetheclocktower commented on the diff Nov 2, 2012
src/prototype/dom/dom.js
@@ -2353,8 +2353,8 @@
name = table.names[attr] || attr;
value = attributes[attr];
if (table.values[attr])
- name = table.values[attr](element, value);
- if (value === false || value === null)
+ table.values[attr](element, value);
+ else if (value === false || value === null)
@savetheclocktower
savetheclocktower Nov 2, 2012 collaborator

Seems like putting the else in here would break being able to say (e.g.)…

checkBox.writeAttribute('checked', false);

…and having the checked attribute be removed.

@savetheclocktower
Collaborator

I ended up merging @sdumitriu's pull request instead, but thanks again for being so vigilant on the bug tracker.

@victor-homyakov

I've missed somehow that pull request, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment