improved bundler, handle width/height atts

This commit is contained in:
Leo Horie 2016-09-23 10:31:33 -04:00
parent e58fa538bc
commit b8ef290acd
13 changed files with 1211 additions and 786 deletions

View file

@ -265,6 +265,17 @@ module.exports = function() {
enumerable: true,
})
}
if (element.nodeName === "CANVAS") {
Object.defineProperty(element, "width", {
get: function() {return this.attributes["width"] ? Math.floor(parseInt(this.attributes["width"].nodeValue) || 0) : 300},
set: function(value) {this.setAttribute("width", Math.floor(Number(value) || 0).toString())},
})
Object.defineProperty(element, "height", {
get: function() {return this.attributes["height"] ? Math.floor(parseInt(this.attributes["height"].nodeValue) || 0) : 300},
set: function(value) {this.setAttribute("height", Math.floor(Number(value) || 0).toString())},
})
}
function getOptions(element) {
var options = []