Fix broken tests

This commit is contained in:
Nikolay Kim 2016-08-06 20:35:46 +03:00
parent 505bd1337a
commit 6d4d0f104f
2 changed files with 84 additions and 10 deletions

View file

@ -1081,18 +1081,21 @@
//
// #348 don't set the value if not needed - otherwise, cursor
// placement breaks in Chrome
// #1195 do not update attribute value if not changed
if (node[attrName] !== dataAttr) {
try {
if (tag !== "input" || node[attrName] !== dataAttr) {
node[attrName] = dataAttr
}
} catch (e) {
node.setAttribute(attrName, dataAttr)
try {
if (tag !== "input" || node[attrName] !== dataAttr) {
node[attrName] = dataAttr
}
} catch (e) {
node.setAttribute(attrName, dataAttr)
}
} else {
try {
node.setAttribute(attrName, dataAttr)
} catch (e) {
// IE8 doesn't allow change input attributes and throws
// an exception. Unfortunately it cannot be handled, because
// error code is not informative.
}
} else if (node[attrName] !== dataAttr) {
node.setAttribute(attrName, dataAttr)
}
}