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

@ -65,7 +65,4 @@ function hyperscript(selector) {
return Vnode(selector, attrs && attrs.key, attrs || {}, Vnode.normalizeChildren(children), undefined, undefined)
}
hyperscript.trust = require("./trust")
hyperscript.fragment = require("./fragment")
module.exports = hyperscript

View file

@ -445,7 +445,7 @@ module.exports = function($window) {
return attr === "oninit" || attr === "oncreate" || attr === "onupdate" || attr === "onremove" || attr === "onbeforeremove" || attr === "onbeforeupdate"
}
function isAttribute(attr) {
return attr === "href" || attr === "list" || attr === "form"// || attr === "type" || attr === "width" || attr === "height"
return attr === "href" || attr === "list" || attr === "form" || attr === "width" || attr === "height"// || attr === "type"
}
function hasIntegrationMethods(source) {
return source != null && (source.oncreate || source.onupdate || source.onbeforeremove || source.onremove)

View file

@ -76,6 +76,16 @@ o.spec("attributes", function() {
o(a.dom.attributes["href"]).equals(undefined)
})
})
o.spec("canvas width and height", function() {
o("uses attribute API", function() {
var canvas = {tag: "canvas", attrs: {width: "100%"}}
render(root, canvas)
o(canvas.dom.attributes["width"].nodeValue).equals("100%")
o(canvas.dom.width).equals(100)
})
})
o.spec("svg class", function() {
o("when className is specified then it should be added as a class", function() {
var a = {tag: "svg", attrs: {className: "test"}}