|
|
|
@ -1,19 +1,23 @@
|
|
|
|
|
var booleanAttrs = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "compact", "controls", "declare",
|
|
|
|
|
"default", "defaultchecked", "defaultmuted", "defaultselected", "defer", "disabled", "draggable",
|
|
|
|
|
"enabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "itemscope", "loop", "multiple",
|
|
|
|
|
"muted", "nohref", "noresize", "noshade", "novalidate", "nowrap", "open", "pauseonexit", "readonly",
|
|
|
|
|
"required", "reversed", "scoped", "seamless", "selected", "sortable", "spellcheck", "translate",
|
|
|
|
|
var booleanAttrs = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "compact", "controls", "declare",
|
|
|
|
|
"default", "defaultchecked", "defaultmuted", "defaultselected", "defer", "disabled", "draggable",
|
|
|
|
|
"enabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "itemscope", "loop", "multiple",
|
|
|
|
|
"muted", "nohref", "noresize", "noshade", "novalidate", "nowrap", "open", "pauseonexit", "readonly",
|
|
|
|
|
"required", "reversed", "scoped", "seamless", "selected", "sortable", "spellcheck", "translate",
|
|
|
|
|
"truespeed", "typemustmatch", "visible"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var booleanAttrsDict = {};
|
|
|
|
|
for(var i=0, len = booleanAttrs.length; i < len; i++) {
|
|
|
|
|
booleanAttrsDict[booleanAttrs[i]] = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function updateAttrs(oldVnode, vnode) {
|
|
|
|
|
var key, cur, old, elm = vnode.elm,
|
|
|
|
|
oldAttrs = oldVnode.data.attrs || {}, attrs = vnode.data.attrs || {};
|
|
|
|
|
|
|
|
|
|
oldAttrs = oldVnode.data.attrs, attrs = vnode.data.attrs;
|
|
|
|
|
|
|
|
|
|
if (!oldAttrs && !attrs) return;
|
|
|
|
|
oldAttrs = oldAttrs || {};
|
|
|
|
|
attrs = attrs || {};
|
|
|
|
|
|
|
|
|
|
// update modified attributes, add new attributes
|
|
|
|
|
for (key in attrs) {
|
|
|
|
|
cur = attrs[key];
|
|
|
|
|