From 86d234eb075a40bb4d8c9d4c6374d2ed28b32eec Mon Sep 17 00:00:00 2001 From: Jethro Larson Date: Tue, 3 Mar 2015 13:27:06 -0800 Subject: [PATCH 1/3] Set base line-height to a decent default. --- docs/layout/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/layout/style.css b/docs/layout/style.css index 8c92cac2..1c63dc6b 100644 --- a/docs/layout/style.css +++ b/docs/layout/style.css @@ -19,7 +19,7 @@ [class*=',12)'] {width:100%;} } -html {background:#999;color:#222;font:14px Helvetica;} +html {background:#999;color:#222;font:14px/1.4 Helvetica;} html,body {margin:0;padding:0;} header,footer {background:#999;} nav {text-align:right;} @@ -89,4 +89,4 @@ background-size: 20px 20px; @-webkit-keyframes logo { from {opacity:0;-webkit-transform:scale(2) rotate(359deg);} to {opacity:1;-webkit-transform:scale(1) rotate(0deg);} -} \ No newline at end of file +} From bfa1767d812467437091f48c8c567cedb0227277 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Fri, 6 Mar 2015 09:00:22 -0500 Subject: [PATCH 2/3] #469 allow html5 values w/ units for width/height attrs --- mithril.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mithril.js b/mithril.js index 2997b392..ec7192ff 100644 --- a/mithril.js +++ b/mithril.js @@ -361,7 +361,7 @@ var m = (function app(window, undefined) { //handle cases that are properties (but ignore cases where we should use setAttribute instead) //- list and form are typically used as strings, but are DOM element references in js //- when using CSS selectors (e.g. `m("[style='']")`), style is used as a string, but it's an object in js - else if (attrName in node && !(attrName === "list" || attrName === "style" || attrName === "form" || attrName === "type")) { + else if (attrName in node && !(attrName === "list" || attrName === "style" || attrName === "form" || attrName === "type" || attrName === "width" || attrName === "height")) { //#348 don't set the value if not needed otherwise cursor placement breaks in Chrome if (tag !== "input" || node[attrName] !== dataAttr) node[attrName] = dataAttr } From b8a7d7217d73c222ef1b3b9de9dbeac54af38b2e Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Mon, 9 Mar 2015 21:30:15 -0400 Subject: [PATCH 3/3] #476 fix conditional --- mithril.js | 2 +- tests/mithril-tests.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index ec7192ff..3458fef5 100644 --- a/mithril.js +++ b/mithril.js @@ -285,7 +285,7 @@ var m = (function app(window, undefined) { configs.push(callback(data, [node, !isNew, context, cached])) } } - else if (typeof dataType != FUNCTION) { + else if (typeof data != FUNCTION) { //handle text nodes var nodes; if (cached.nodes.length === 0) { diff --git a/tests/mithril-tests.js b/tests/mithril-tests.js index 7c57748d..a0f9d307 100644 --- a/tests/mithril-tests.js +++ b/tests/mithril-tests.js @@ -41,7 +41,7 @@ function testMithril(mock) { test(function() {return m("div", [1, 2, 3], [4, 5, 6, 7]).children[0].length === 3}) test(function() {return m("div", [1, 2, 3], [4, 5, 6, 7]).children[1].length === 4}) test(function() {return m("div", [1], [2], [3]).children.length === 3}) - + //m.module test(function() { mock.requestAnimationFrame.$resolve() @@ -853,6 +853,11 @@ function testMithril(mock) { ]) return root.childNodes.map(function(node) {return node.id}).join() == "div-1,div-3,div-2" }) + test(function() { + var root = mock.document.createElement("div") + m.render(root, m("div", function() {})) + return root.childNodes[0].childNodes.length == 0 + }) //end m.render //m.redraw