diff --git a/src/compiler/CompileContext.js b/src/compiler/CompileContext.js index 6fa9d83ce..6bf8b0ac9 100644 --- a/src/compiler/CompileContext.js +++ b/src/compiler/CompileContext.js @@ -22,11 +22,9 @@ const markoPkgVersion = require("../../package.json").version; const rootDir = path.join(__dirname, "../"); const isDebug = require("../build.json").isDebug; -// const FLAG_IS_SVG = 1; -// const FLAG_IS_TEXTAREA = 2; -// const FLAG_SIMPLE_ATTRS = 4; -// const FLAG_PRESERVE = 8; -const FLAG_CUSTOM_ELEMENT = 16; +// const FLAG_SIMPLE_ATTRS = 1; +// const FLAG_PRESERVE = 2; +const FLAG_CUSTOM_ELEMENT = 4; const FLAG_PRESERVE_WHITESPACE = "PRESERVE_WHITESPACE"; diff --git a/src/compiler/ast/HtmlElement/index.js b/src/compiler/ast/HtmlElement/index.js index c2df029e8..3014e2eb8 100644 --- a/src/compiler/ast/HtmlElement/index.js +++ b/src/compiler/ast/HtmlElement/index.js @@ -11,12 +11,6 @@ function beforeGenerateCode(event) { var tagName = event.node.tagName; var context = event.context; - var tagDef = - typeof tagName === "string" ? context.getTagDef(tagName) : undefined; - if (tagDef && tagDef.htmlType === "svg") { - context.pushFlag("SVG"); - } - if (tagName === "script") { context.pushFlag("SCRIPT_BODY"); } @@ -29,13 +23,6 @@ function afterGenerateCode(event) { var tagName = event.node.tagName; var context = event.context; - var tagDef = - typeof tagName === "string" ? context.getTagDef(tagName) : undefined; - - if (tagDef && tagDef.htmlType === "svg") { - context.popFlag("SVG"); - } - if (tagName === "script") { context.popFlag("SCRIPT_BODY"); } diff --git a/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js b/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js index 946ed704d..f780d7a88 100644 --- a/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js +++ b/src/compiler/ast/HtmlElement/vdom/HtmlElementVDOM.js @@ -3,11 +3,9 @@ const Node = require("../../Node"); const vdomUtil = require("../../../util/vdom"); -const FLAG_IS_SVG = 1; -const FLAG_IS_TEXTAREA = 2; -const FLAG_SIMPLE_ATTRS = 4; -// const FLAG_PRESERVE = 8; -// const FLAG_CUSTOM_ELEMENT = 16; +const FLAG_SIMPLE_ATTRS = 1; +// const FLAG_PRESERVE = 2; +// const FLAG_CUSTOM_ELEMENT = 4; let CREATE_ARGS_COUNT = 0; const INDEX_TAG_NAME = CREATE_ARGS_COUNT++; @@ -44,13 +42,6 @@ function finalizeCreateArgs(createArgs, builder) { return createArgs; } -const MAYBE_SVG = { - a: true, - script: true, - style: true, - title: true -}; - const SIMPLE_ATTRS = { class: true, style: true, @@ -86,8 +77,6 @@ class HtmlElementVDOM extends Node { this.runtimeFlags = def.runtimeFlags; this.isAutoKeyed = def.isAutoKeyed; - this.isSVG = false; - this.isTextArea = false; this.hasAttributes = false; this.hasSimpleAttrs = false; // This will be set to true if the HTML element // only attributes in the following set: @@ -105,30 +94,15 @@ class HtmlElementVDOM extends Node { vdomUtil.registerOptimizer(context); - let tagName = this.tagName; + const tagName = this.tagName; if (tagName.type === "Literal" && typeof tagName.value === "string") { - let tagDef = context.getTagDef(tagName.value); - if (tagDef) { - if (tagDef.htmlType === "svg") { - this.isSVG = true; - } else { - if (MAYBE_SVG[tagName.value] && context.isFlagSet("SVG")) { - this.isSVG = true; - } else { - this.tagName = tagName = builder.literal( - tagName.value.toUpperCase() - ); - - if (tagName.value === "TEXTAREA") { - this.isTextArea = true; - } - } - } - } + const tagDef = context.getTagDef(tagName.value); this.isLiteralTag = true; - } else if (context.isFlagSet("SVG")) { - this.isSVG = true; + + if (tagDef && tagDef.html && !tagDef.htmlType) { + tagName.value = tagName.value.toLowerCase(); + } } let attributes = this.attributes; @@ -273,14 +247,6 @@ class HtmlElementVDOM extends Node { var flags = 0; - if (this.isSVG) { - flags |= FLAG_IS_SVG; - } - - if (this.isTextArea) { - flags |= FLAG_IS_TEXTAREA; - } - if (this.hasSimpleAttrs) { flags |= FLAG_SIMPLE_ATTRS; } @@ -316,9 +282,7 @@ class HtmlElementVDOM extends Node { writer.write("."); funcCall = builder.functionCall( - builder.identifier( - this.isLiteralTag || this.isSVG ? "e" : "ed" - ), + builder.identifier("e"), createArgs ); } else if (this.isStatic && this.createElementId) { @@ -326,17 +290,13 @@ class HtmlElementVDOM extends Node { } else if (this.isHtmlOnly) { writer.write("out."); funcCall = builder.functionCall( - builder.identifier( - this.isLiteralTag || this.isSVG ? "e" : "ed" - ), + builder.identifier("e"), createArgs ); } else { writer.write("out."); funcCall = builder.functionCall( - builder.identifier( - this.isLiteralTag || this.isSVG ? "be" : "bed" - ), + builder.identifier("be"), createArgs ); } diff --git a/src/core-tags/components/preserve-tag-browser.js b/src/core-tags/components/preserve-tag-browser.js index f3bbcf020..2a9cab02b 100644 --- a/src/core-tags/components/preserve-tag-browser.js +++ b/src/core-tags/components/preserve-tag-browser.js @@ -36,7 +36,7 @@ module.exports = function render(input, out) { key, null, 0, - 8 /* FLAG_PRESERVE */ + 2 /* FLAG_PRESERVE */ ); globalComponentsContext.___preservedEls[ component.id + "-" + key diff --git a/src/core-tags/marko.json b/src/core-tags/marko.json index 6779b7708..bfe1cea1d 100644 --- a/src/core-tags/marko.json +++ b/src/core-tags/marko.json @@ -5,6 +5,7 @@ "./core/marko.json", "./html/marko.json", "./migrate/marko.json", - "./svg/marko.json" + "./svg/marko.json", + "./math/marko.json" ] } diff --git a/src/core-tags/math/marko.json b/src/core-tags/math/marko.json new file mode 100644 index 000000000..e3b8bd5d4 --- /dev/null +++ b/src/core-tags/math/marko.json @@ -0,0 +1,45 @@ +{ + "taglib-id": "marko-math", + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" }, + "": { "html": true, "htmlType": "math" } +} diff --git a/src/runtime/vdom/AsyncVDOMBuilder.js b/src/runtime/vdom/AsyncVDOMBuilder.js index 52d537367..e5c3d337a 100644 --- a/src/runtime/vdom/AsyncVDOMBuilder.js +++ b/src/runtime/vdom/AsyncVDOMBuilder.js @@ -106,7 +106,7 @@ var proto = (AsyncVDOMBuilder.prototype = { flags, props ) { - var element = VElement.___createElementDynamicTag( + return this.element( tagName, attrsHelper(attrs), key, @@ -115,7 +115,6 @@ var proto = (AsyncVDOMBuilder.prototype = { flags, props ); - return this.___beginNode(element, childCount); }, n: function(node, component) { @@ -196,7 +195,7 @@ var proto = (AsyncVDOMBuilder.prototype = { flags, props ) { - var element = VElement.___createElementDynamicTag( + return this.beginElement( tagName, attrsHelper(attrs), key, @@ -205,8 +204,6 @@ var proto = (AsyncVDOMBuilder.prototype = { flags, props ); - this.___beginNode(element, childCount, true); - return this; }, ___beginFragment: function(key, component, preserve) { @@ -427,7 +424,7 @@ var proto = (AsyncVDOMBuilder.prototype = { var vdomTree = this.___getOutput(); // Create the root document fragment node doc = doc || this.___document || document; - this.___vnode = node = vdomTree.___actualize(doc); + this.___vnode = node = vdomTree.___actualize(doc, null); morphdom(node, vdomTree, doc, this.___components); } return node; diff --git a/src/runtime/vdom/VElement.js b/src/runtime/vdom/VElement.js index c06a97246..ab2e4d0d6 100644 --- a/src/runtime/vdom/VElement.js +++ b/src/runtime/vdom/VElement.js @@ -3,17 +3,22 @@ var domData = require("../components/dom-data"); var vElementByDOMNode = domData.___vElementByDOMNode; var VNode = require("./VNode"); var inherit = require("raptor-util/inherit"); -var NS_XLINK = "http://www.w3.org/1999/xlink"; var ATTR_XLINK_HREF = "xlink:href"; var xmlnsRegExp = /^xmlns(:|$)/; +var NS_XLINK = "http://www.w3.org/1999/xlink"; +var NS_HTML = "http://www.w3.org/1999/xhtml"; +var NS_MATH = "http://www.w3.org/1998/Math/MathML"; +var NS_SVG = "http://www.w3.org/2000/svg"; +var DEFAULT_NS = { + svg: NS_SVG, + math: NS_MATH +}; var toString = String; -var FLAG_IS_SVG = 1; -var FLAG_IS_TEXTAREA = 2; -var FLAG_SIMPLE_ATTRS = 4; -// var FLAG_PRESERVE = 8; -var FLAG_CUSTOM_ELEMENT = 16; +var FLAG_SIMPLE_ATTRS = 1; +// var FLAG_PRESERVE = 2; +var FLAG_CUSTOM_ELEMENT = 4; var defineProperty = Object.defineProperty; @@ -62,12 +67,10 @@ function VElementClone(other) { this.___key = other.___key; this.___attributes = other.___attributes; this.___properties = other.___properties; - this.___namespaceURI = other.___namespaceURI; this.___nodeName = other.___nodeName; this.___flags = other.___flags; this.___valueInternal = other.___valueInternal; this.___constId = other.___constId; - this.___isTextArea = other.___isTextArea; } function VElement( @@ -82,31 +85,19 @@ function VElement( this.___VNode(childCount); var constId; - var namespaceURI; - var isTextArea; if (props) { constId = props.i; } - if ((this.___flags = flags || 0)) { - if (flags & FLAG_IS_SVG) { - namespaceURI = "http://www.w3.org/2000/svg"; - } - if (flags & FLAG_IS_TEXTAREA) { - isTextArea = true; - } - } - this.___key = key; + this.___flags = flags || 0; this.___ownerComponent = ownerComponent; this.___attributes = attrs || EMPTY_OBJECT; this.___properties = props || EMPTY_OBJECT; - this.___namespaceURI = namespaceURI; this.___nodeName = tagName; this.___valueInternal = null; this.___constId = constId; - this.___isTextArea = isTextArea; } VElement.prototype = { @@ -143,41 +134,6 @@ VElement.prototype = { } }, - /** - * Shorthand method for creating and appending an HTML element with a dynamic namespace - * - * @param {String} tagName The tag name (e.g. "div") - * @param {int|null} attrCount The number of attributes (or `null` if not known) - * @param {int|null} childCount The number of child nodes (or `null` if not known) - */ - ed: function( - tagName, - attrs, - key, - ownerComponent, - childCount, - flags, - props - ) { - var child = this.___appendChild( - VElement.___createElementDynamicTag( - tagName, - attrs, - key, - ownerComponent, - childCount, - flags, - props - ) - ); - - if (childCount === 0) { - return this.___finishChild(); - } else { - return child; - } - }, - /** * Shorthand method for creating and appending a static node. The provided node is automatically cloned * using a shallow clone since it will be mutated as a result of setting `nextSibling` and `parentNode`. @@ -191,17 +147,13 @@ VElement.prototype = { return this.___finishChild(); }, - ___actualize: function(doc) { - var namespaceURI = this.___namespaceURI; + ___actualize: function(doc, parentNamespaceURI) { var tagName = this.___nodeName; - var attributes = this.___attributes; - var flags = this.___flags; + var namespaceURI = DEFAULT_NS[tagName] || parentNamespaceURI || NS_HTML; - var el = - namespaceURI !== undefined - ? doc.createElementNS(namespaceURI, tagName) - : doc.createElement(tagName); + var flags = this.___flags; + var el = doc.createElementNS(namespaceURI, tagName); if (flags & FLAG_CUSTOM_ELEMENT) { assign(el, attributes); @@ -226,7 +178,7 @@ VElement.prototype = { } } - if (flags & FLAG_IS_TEXTAREA) { + if (tagName === "textarea") { el.value = this.___value; } } @@ -273,30 +225,6 @@ defineProperty(proto, "___value", { } }); -VElement.___createElementDynamicTag = function( - tagName, - attrs, - key, - ownerComponent, - childCount, - flags, - props -) { - var namespace = attrs && attrs.xmlns; - tagName = namespace ? tagName : tagName.toUpperCase(); - var element = new VElement( - tagName, - attrs, - key, - ownerComponent, - childCount, - flags, - props - ); - element.___namespaceURI = namespace; - return element; -}; - VElement.___removePreservedAttributes = function(attrs) { // By default this static method is a no-op, but if there are any // compiled components that have "no-update" attributes then @@ -327,11 +255,10 @@ function virtualizeElement(node, virtualizeChildNodes) { } } - var flags = 0; - var tagName = node.nodeName; - if (tagName === "TEXTAREA") { - flags |= FLAG_IS_TEXTAREA; + + if (node.namespaceURI === NS_HTML) { + tagName = tagName.toLowerCase(); } var vdomEl = new VElement( @@ -340,19 +267,14 @@ function virtualizeElement(node, virtualizeChildNodes) { null /*key*/, null /*ownerComponent*/, 0 /*child count*/, - flags, + 0 /*flags*/, null /*props*/ ); - if (node.namespaceURI !== "http://www.w3.org/1999/xhtml") { - vdomEl.___namespaceURI = node.namespaceURI; - } - if (vdomEl.___isTextArea) { + if (vdomEl.___nodeName === "textarea") { vdomEl.___valueInternal = node.value; - } else { - if (virtualizeChildNodes) { - virtualizeChildNodes(node, vdomEl); - } + } else if (virtualizeChildNodes) { + virtualizeChildNodes(node, vdomEl); } return vdomEl; diff --git a/src/runtime/vdom/VNode.js b/src/runtime/vdom/VNode.js index f2fc9bb67..dda0de237 100644 --- a/src/runtime/vdom/VNode.js +++ b/src/runtime/vdom/VNode.js @@ -49,7 +49,7 @@ VNode.prototype = { ___appendChild: function(child) { this.___childCount++; - if (this.___isTextArea === true) { + if (this.___nodeName === "textarea") { if (child.___Text) { var childValue = child.___nodeValue; this.___valueInternal = diff --git a/src/runtime/vdom/morphdom/index.js b/src/runtime/vdom/morphdom/index.js index 5fde6d962..9a6ec09ef 100644 --- a/src/runtime/vdom/morphdom/index.js +++ b/src/runtime/vdom/morphdom/index.js @@ -32,11 +32,9 @@ var COMMENT_NODE = 8; var COMPONENT_NODE = 2; var FRAGMENT_NODE = 12; -// var FLAG_IS_SVG = 1; -// var FLAG_IS_TEXTAREA = 2; -// var FLAG_SIMPLE_ATTRS = 4; -var FLAG_PRESERVE = 8; -// var FLAG_CUSTOM_ELEMENT = 16; +// var FLAG_SIMPLE_ATTRS = 1; +var FLAG_PRESERVE = 2; +// var FLAG_CUSTOM_ELEMENT = 4; function isAutoKey(key) { return !/^@/.test(key); @@ -46,6 +44,10 @@ function compareNodeNames(fromEl, toEl) { return fromEl.___nodeName === toEl.___nodeName; } +function caseInsensitiveCompare(a, b) { + return a.toLowerCase() === b.toLowerCase(); +} + function onNodeAdded(node, componentsContext) { if (node.nodeType === 1) { eventDelegation.___handleNodeAttach(node, componentsContext); @@ -70,7 +72,7 @@ function morphdom(fromNode, toNode, doc, componentsContext) { ownerComponent, parentComponent ) { - var realNode = vNode.___actualize(doc); + var realNode = vNode.___actualize(doc, parentEl.namespaceURI); insertBefore(realNode, referenceEl, parentEl); if ( @@ -329,12 +331,16 @@ function morphdom(fromNode, toNode, doc, componentsContext) { if (isRerenderInBrowser === true && curFromNodeChild) { if ( curFromNodeChild.nodeType === ELEMENT_NODE && - curFromNodeChild.nodeName === - curToNodeChild.___nodeName + caseInsensitiveCompare( + curFromNodeChild.nodeName, + curToNodeChild.___nodeName || "" + ) ) { curVFromNodeChild = virtualizeElement( curFromNodeChild ); + curVFromNodeChild.___nodeName = + curToNodeChild.___nodeName; keysByDOMNode.set( curFromNodeChild, curToNodeKey @@ -598,6 +604,16 @@ function morphdom(fromNode, toNode, doc, componentsContext) { curVFromNodeChild = virtualizeElement( curFromNodeChild ); + + if ( + caseInsensitiveCompare( + curVFromNodeChild.___nodeName, + curToNodeChild.___nodeName + ) + ) { + curVFromNodeChild.___nodeName = + curToNodeChild.___nodeName; + } } else { // Skip over nodes that don't look like ours... curFromNodeChild = fromNextSibling; @@ -763,7 +779,7 @@ function morphdom(fromNode, toNode, doc, componentsContext) { return; } - if (nodeName !== "TEXTAREA") { + if (nodeName !== "textarea") { morphChildren(fromEl, toEl, parentComponent); } diff --git a/src/runtime/vdom/morphdom/specialElHandlers.js b/src/runtime/vdom/morphdom/specialElHandlers.js index 2bd4b3708..a9a240bce 100644 --- a/src/runtime/vdom/morphdom/specialElHandlers.js +++ b/src/runtime/vdom/morphdom/specialElHandlers.js @@ -16,10 +16,10 @@ SpecialElHandlers.prototype = { * Needed for IE. Apparently IE doesn't think that "selected" is an * attribute when reading over the attributes using selectEl.attributes */ - OPTION: function(fromEl, toEl) { + option: function(fromEl, toEl) { syncBooleanAttrProp(fromEl, toEl, "selected"); }, - BUTTON: function(fromEl, toEl) { + button: function(fromEl, toEl) { syncBooleanAttrProp(fromEl, toEl, "disabled"); }, /** @@ -28,7 +28,7 @@ SpecialElHandlers.prototype = { * "value" property will have no effect since it is only used to the set the * initial value. Similar for the "checked" attribute, and "disabled". */ - INPUT: function(fromEl, toEl) { + input: function(fromEl, toEl) { syncBooleanAttrProp(fromEl, toEl, "checked"); syncBooleanAttrProp(fromEl, toEl, "disabled"); @@ -41,7 +41,7 @@ SpecialElHandlers.prototype = { } }, - TEXTAREA: function(fromEl, toEl) { + textarea: function(fromEl, toEl) { var newValue = toEl.___value; if (fromEl.value != newValue) { fromEl.value = newValue; @@ -63,13 +63,13 @@ SpecialElHandlers.prototype = { firstChild.nodeValue = newValue; } }, - SELECT: function(fromEl, toEl) { + select: function(fromEl, toEl) { if (!toEl.___hasAttribute("multiple")) { var i = -1; var selected = 0; var curChild = toEl.___firstChild; while (curChild) { - if (curChild.___nodeName == "OPTION") { + if (curChild.___nodeName === "option") { i++; if (curChild.___hasAttribute("selected")) { selected = i; diff --git a/test/__util__/toHTML.js b/test/__util__/toHTML.js index ba06aa319..8022272d1 100644 --- a/test/__util__/toHTML.js +++ b/test/__util__/toHTML.js @@ -85,7 +85,11 @@ function toHTML(node) { html += ">\n"; if (tagName.toUpperCase() === "TEXTAREA") { - html += indent + " VALUE: " + JSON.stringify(el.value) + "\n"; + html += + indent + + " VALUE: " + + JSON.stringify(el.value || el.___value) + + "\n"; } else { var curChild = getFirstChild(el); while (curChild) { diff --git a/test/compiler/fixtures-vdom/arrow-function-event-handler/expected.js b/test/compiler/fixtures-vdom/arrow-function-event-handler/expected.js index d2d5336f1..7ab75edeb 100644 --- a/test/compiler/fixtures-vdom/arrow-function-event-handler/expected.js +++ b/test/compiler/fixtures-vdom/arrow-function-event-handler/expected.js @@ -12,7 +12,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), function render(input, out, __component, component, state) { var data = input; - out.e("DIV", null, "0", component, 0, 0, { + out.e("div", null, "0", component, 0, 0, { onclick: __component.d("click", () => console.log("handled"), false) }); } diff --git a/test/compiler/fixtures-vdom/macro-in-loop/expected.js b/test/compiler/fixtures-vdom/macro-in-loop/expected.js index f66e2a2a7..15bf867fb 100644 --- a/test/compiler/fixtures-vdom/macro-in-loop/expected.js +++ b/test/compiler/fixtures-vdom/macro-in-loop/expected.js @@ -21,7 +21,7 @@ function render(input, out, __component, component, state) { marko_forRange(0, 10, null, function(i) { var keyscope__1 = "[" + ((for__0++) + "]"); - out.e("DIV", null, "2" + keyscope__1, component, 1) + out.e("div", null, "2" + keyscope__1, component, 1) .t(i); function macro_renderTree(out, node) { @@ -32,14 +32,14 @@ function render(input, out, __component, component, state) { out.t(" Children: "); if (node.children) { - out.be("UL", null, "3", component); + out.be("ul", null, "3", component); var for__4 = 0; marko_forEach(node.children, function(child) { var keyscope__5 = "[" + ((for__4++) + "]"); - out.be("LI", null, "6" + keyscope__5, component); + out.be("li", null, "6" + keyscope__5, component); marko_dynamicTag(out, macro_renderTree, child, null, null, __component, "7" + keyscope__5); diff --git a/test/compiler/fixtures-vdom/simple/expected.js b/test/compiler/fixtures-vdom/simple/expected.js index 372e7d420..777f4502d 100644 --- a/test/compiler/fixtures-vdom/simple/expected.js +++ b/test/compiler/fixtures-vdom/simple/expected.js @@ -13,11 +13,11 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("295cea"), - marko_node0 = marko_createElement("DIV", null, "4", null, 1, 0, { + marko_node0 = marko_createElement("div", null, "4", null, 1, 0, { i: marko_const_nextId() }) .t("No colors!"), - marko_node1 = marko_createElement("DIV", null, "9", null, 1, 0, { + marko_node1 = marko_createElement("div", null, "9", null, 1, 0, { i: marko_const_nextId() }) .t("No colors!"); @@ -32,14 +32,14 @@ function render(input, out, __component, component, state) { out.t("! "); if (input.colors.length) { - out.be("UL", null, "0", component); + out.be("ul", null, "0", component); var for__1 = 0; marko_forEach(input.colors, function(color) { var keyscope__2 = "[" + ((for__1++) + "]"); - out.e("LI", null, "3" + keyscope__2, component, 1) + out.e("li", null, "3" + keyscope__2, component, 1) .t(color); }); @@ -49,14 +49,14 @@ function render(input, out, __component, component, state) { } if (input.colors.length) { - out.be("UL", null, "5", component); + out.be("ul", null, "5", component); var for__6 = 0; marko_forEach(input.colors, function(color) { var keyscope__7 = "[" + ((for__6++) + "]"); - out.e("LI", null, "8" + keyscope__7, component, 1) + out.e("li", null, "8" + keyscope__7, component, 1) .t(color); }); diff --git a/test/compiler/fixtures-vdom/svg-anchor/expected.js b/test/compiler/fixtures-vdom/svg-anchor/expected.js index 5da91ec36..da1024dba 100644 --- a/test/compiler/fixtures-vdom/svg-anchor/expected.js +++ b/test/compiler/fixtures-vdom/svg-anchor/expected.js @@ -15,13 +15,13 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_node0 = marko_createElement("svg", { width: "140", height: "30" - }, "0", null, 1, 1, { + }, "0", null, 1, 0, { i: marko_const_nextId() }) .e("a", { "xlink:href": "https://developer.mozilla.org/en-US/docs/SVG", target: "_blank" - }, null, null, 0, 1); + }, null, null, 0); function render(input, out, __component, component, state) { var data = input; diff --git a/test/compiler/fixtures-vdom/svg-dynamic-tag-name/expected.js b/test/compiler/fixtures-vdom/svg-dynamic-tag-name/expected.js index 706fe21af..f3d23e19e 100644 --- a/test/compiler/fixtures-vdom/svg-dynamic-tag-name/expected.js +++ b/test/compiler/fixtures-vdom/svg-dynamic-tag-name/expected.js @@ -20,7 +20,7 @@ function render(input, out, __component, component, state) { var isCircle = true; - out.be("svg", marko_attrs0, "0", component, null, 1); + out.be("svg", marko_attrs0, "0", component); marko_dynamicTag(out, isCircle ? "circle" : "square", { width: 200, diff --git a/test/compiler/fixtures-vdom/svg-title/expected.js b/test/compiler/fixtures-vdom/svg-title/expected.js index 3ef2fc1bd..f96ce1048 100644 --- a/test/compiler/fixtures-vdom/svg-title/expected.js +++ b/test/compiler/fixtures-vdom/svg-title/expected.js @@ -15,11 +15,11 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_node0 = marko_createElement("svg", { width: "140", height: "30" - }, "0", null, 1, 1, { + }, "0", null, 1, 0, { i: marko_const_nextId() }) - .e("g", null, null, null, 1, 1) - .e("title", null, null, null, 1, 1) + .e("g", null, null, null, 1) + .e("title", null, null, null, 1) .t("This is a tool tip"); function render(input, out, __component, component, state) { diff --git a/test/compiler/fixtures-vdom/svg/expected.js b/test/compiler/fixtures-vdom/svg/expected.js index d9777cfc3..cf1ab9fae 100644 --- a/test/compiler/fixtures-vdom/svg/expected.js +++ b/test/compiler/fixtures-vdom/svg/expected.js @@ -15,14 +15,14 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_node0 = marko_createElement("svg", { viewBox: "0 0 200 200", xmlns: "http://www.w3.org/2000/svg" - }, "0", null, 1, 1, { + }, "0", null, 1, 0, { i: marko_const_nextId() }) .e("circle", { cx: "100", cy: "100", r: "100" - }, null, null, 0, 1); + }, null, null, 0); function render(input, out, __component, component, state) { var data = input; diff --git a/test/components-browser/fixtures/dynamic-tag-default-namespace/index.marko b/test/components-browser/fixtures/dynamic-tag-default-namespace/index.marko new file mode 100644 index 000000000..84148ce7e --- /dev/null +++ b/test/components-browser/fixtures/dynamic-tag-default-namespace/index.marko @@ -0,0 +1,11 @@ +class {} + +
+ <${true ? "svg" : "a"}> + Test + + + <${true ? "math" : "a"}> + Test + +
\ No newline at end of file diff --git a/test/components-browser/fixtures/dynamic-tag-default-namespace/test.js b/test/components-browser/fixtures/dynamic-tag-default-namespace/test.js new file mode 100644 index 000000000..80e78a0ef --- /dev/null +++ b/test/components-browser/fixtures/dynamic-tag-default-namespace/test.js @@ -0,0 +1,14 @@ +var expect = require("chai").expect; +var svgNS = "http://www.w3.org/2000/svg"; +var mathNS = "http://www.w3.org/1998/Math/MathML"; + +module.exports = function(helpers) { + var component = helpers.mount(require.resolve("./index")); + var root = component.getEl("root"); + var svgEl = root.firstChild; + var mathEl = svgEl.nextSibling; + expect(svgEl.namespaceURI).to.equal(svgNS); + expect(svgEl.firstChild.namespaceURI).to.equal(svgNS); + expect(mathEl.namespaceURI).to.equal(mathNS); + expect(mathEl.firstChild.namespaceURI).to.equal(mathNS); +}; diff --git a/test/components-compilation/fixtures-vdom/boundary-el-if-el/expected.js b/test/components-compilation/fixtures-vdom/boundary-el-if-el/expected.js index 0b79f2673..adbbf1640 100644 --- a/test/components-compilation/fixtures-vdom/boundary-el-if-el/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-el-if-el/expected.js @@ -13,13 +13,13 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("441cd5"), - marko_node0 = marko_createElement("H1", null, "0", null, 0, 0, { + marko_node0 = marko_createElement("h1", null, "0", null, 0, 0, { i: marko_const_nextId() }), - marko_node1 = marko_createElement("DIV", null, "2", null, 0, 0, { + marko_node1 = marko_createElement("div", null, "2", null, 0, 0, { i: marko_const_nextId() }), - marko_node2 = marko_createElement("SPAN", null, "1", null, 0, 0, { + marko_node2 = marko_createElement("span", null, "1", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-el-if/expected.js b/test/components-compilation/fixtures-vdom/boundary-el-if/expected.js index 16e7beea6..806638a67 100644 --- a/test/components-compilation/fixtures-vdom/boundary-el-if/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-el-if/expected.js @@ -13,10 +13,10 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("ee4c02"), - marko_node0 = marko_createElement("H1", null, "0", null, 0, 0, { + marko_node0 = marko_createElement("h1", null, "0", null, 0, 0, { i: marko_const_nextId() }), - marko_node1 = marko_createElement("SPAN", null, "1", null, 0, 0, { + marko_node1 = marko_createElement("span", null, "1", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-el-no-output-tag/expected.js b/test/components-compilation/fixtures-vdom/boundary-el-no-output-tag/expected.js index 835054554..222ac37e4 100644 --- a/test/components-compilation/fixtures-vdom/boundary-el-no-output-tag/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-el-no-output-tag/expected.js @@ -15,7 +15,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("4529ef"), - marko_node0 = marko_createElement("DIV", null, "0", null, 0, 0, { + marko_node0 = marko_createElement("div", null, "0", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-html-tag/expected.js b/test/components-compilation/fixtures-vdom/boundary-html-tag/expected.js index d91cb11e0..ec5579cca 100644 --- a/test/components-compilation/fixtures-vdom/boundary-html-tag/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-html-tag/expected.js @@ -17,12 +17,12 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("5b1bc3"), - marko_node0 = marko_createElement("HEAD", null, "1", null, 1, 0, { + marko_node0 = marko_createElement("head", null, "1", null, 1, 0, { i: marko_const_nextId() }) - .e("TITLE", null, null, null, 1) + .e("title", null, null, null, 1) .t("Hello"), - marko_node1 = marko_createElement("H1", null, "4", null, 1, 0, { + marko_node1 = marko_createElement("h1", null, "4", null, 1, 0, { i: marko_const_nextId() }) .t("Hello"); @@ -30,11 +30,11 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), function render(input, out, __component, component, state) { var data = input; - out.be("HTML", null, "0", component); + out.be("html", null, "0", component); out.n(marko_node0, component); - out.be("BODY", null, "3", component); + out.be("body", null, "3", component); component_globals_tag({}, out); diff --git a/test/components-compilation/fixtures-vdom/boundary-if-el/expected.js b/test/components-compilation/fixtures-vdom/boundary-if-el/expected.js index 870de7810..a620a43f5 100644 --- a/test/components-compilation/fixtures-vdom/boundary-if-el/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-if-el/expected.js @@ -13,10 +13,10 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("5854ef"), - marko_node0 = marko_createElement("H1", null, "1", null, 0, 0, { + marko_node0 = marko_createElement("h1", null, "1", null, 0, 0, { i: marko_const_nextId() }), - marko_node1 = marko_createElement("SPAN", null, "0", null, 0, 0, { + marko_node1 = marko_createElement("span", null, "0", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-if-root/expected.js b/test/components-compilation/fixtures-vdom/boundary-if-root/expected.js index 129011397..f6130e3a8 100644 --- a/test/components-compilation/fixtures-vdom/boundary-if-root/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-if-root/expected.js @@ -13,7 +13,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("0ec49e"), - marko_node0 = marko_createElement("DIV", null, "0", null, 0, 0, { + marko_node0 = marko_createElement("div", null, "0", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-custom-tag-no-key/expected.js b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-custom-tag-no-key/expected.js index 2d9f3b428..17a789f57 100644 --- a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-custom-tag-no-key/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-custom-tag-no-key/expected.js @@ -18,7 +18,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), function render(input, out, __component, component, state) { var data = input; - out.e("H1", null, "@" + input.myStartKey, component, 0); + out.e("h1", null, "@" + input.myStartKey, component, 0); my_component_tag({}, out, __component, "0"); } diff --git a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-id-custom-tag-key/expected.js b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-id-custom-tag-key/expected.js index 9165c57a5..967d1e71e 100644 --- a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-id-custom-tag-key/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-el-id-custom-tag-key/expected.js @@ -17,7 +17,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("0a6612"), - marko_node0 = marko_createElement("H1", { + marko_node0 = marko_createElement("h1", { id: "myStart" }, "0", null, 0, 0, { i: marko_const_nextId() diff --git a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-dynamic/expected.js b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-dynamic/expected.js index e1cce74e4..7dc896ec6 100644 --- a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-dynamic/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-dynamic/expected.js @@ -13,13 +13,13 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), function render(input, out, __component, component, state) { var data = input; - out.e("H1", { + out.e("h1", { id: input.myStart - }, "0", component, 0, 4); + }, "0", component, 0, 1); - out.e("DIV", { + out.e("div", { id: input.myEnd - }, "1", component, 0, 4); + }, "1", component, 0, 1); } marko_template._ = marko_renderer(render, { diff --git a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-static/expected.js b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-static/expected.js index 25ffac190..9e0727f69 100644 --- a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-static/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-ids-static/expected.js @@ -13,12 +13,12 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("522184"), - marko_node0 = marko_createElement("H1", { + marko_node0 = marko_createElement("h1", { id: "myStart" }, "0", null, 0, 0, { i: marko_const_nextId() }), - marko_node1 = marko_createElement("DIV", { + marko_node1 = marko_createElement("div", { id: "myEnd" }, "1", null, 0, 0, { i: marko_const_nextId() diff --git a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys-dynamic/expected.js b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys-dynamic/expected.js index 41f806704..a1683bba3 100644 --- a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys-dynamic/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys-dynamic/expected.js @@ -13,9 +13,9 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), function render(input, out, __component, component, state) { var data = input; - out.e("H1", null, "@" + input.myStartKey, component, 0); + out.e("h1", null, "@" + input.myStartKey, component, 0); - out.e("DIV", null, "@" + input.myEndKey, component, 0); + out.e("div", null, "@" + input.myEndKey, component, 0); } marko_template._ = marko_renderer(render, { diff --git a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys/expected.js b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys/expected.js index 3d8fbdb83..c607f0320 100644 --- a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els-keys/expected.js @@ -13,10 +13,10 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("339bea"), - marko_node0 = marko_createElement("H1", null, "@myStart", null, 0, 0, { + marko_node0 = marko_createElement("h1", null, "@myStart", null, 0, 0, { i: marko_const_nextId() }), - marko_node1 = marko_createElement("DIV", null, "@myEnd", null, 0, 0, { + marko_node1 = marko_createElement("div", null, "@myEnd", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els/expected.js b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els/expected.js index 1a6e0645d..151646165 100644 --- a/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-multi-root-html-els/expected.js @@ -13,10 +13,10 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("75995e"), - marko_node0 = marko_createElement("H1", null, "0", null, 0, 0, { + marko_node0 = marko_createElement("h1", null, "0", null, 0, 0, { i: marko_const_nextId() }), - marko_node1 = marko_createElement("DIV", null, "1", null, 0, 0, { + marko_node1 = marko_createElement("div", null, "1", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-no-output-tag-el/expected.js b/test/components-compilation/fixtures-vdom/boundary-no-output-tag-el/expected.js index be4052101..6cca4b0e6 100644 --- a/test/components-compilation/fixtures-vdom/boundary-no-output-tag-el/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-no-output-tag-el/expected.js @@ -15,7 +15,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("de2191"), - marko_node0 = marko_createElement("DIV", null, "0", null, 0, 0, { + marko_node0 = marko_createElement("div", null, "0", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-dynamic-id/expected.js b/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-dynamic-id/expected.js index e90f0c45d..085b64954 100644 --- a/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-dynamic-id/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-dynamic-id/expected.js @@ -13,9 +13,9 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), function render(input, out, __component, component, state) { var data = input; - out.e("DIV", { + out.e("div", { id: input.id - }, "0", component, 0, 4); + }, "0", component, 0, 1); } marko_template._ = marko_renderer(render, { diff --git a/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-static-id/expected.js b/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-static-id/expected.js index 9dba64c9b..3aed46161 100644 --- a/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-static-id/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-single-root-html-el-static-id/expected.js @@ -13,7 +13,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("f2c765"), - marko_node0 = marko_createElement("DIV", { + marko_node0 = marko_createElement("div", { id: "foo" }, "0", null, 0, 0, { i: marko_const_nextId() diff --git a/test/components-compilation/fixtures-vdom/boundary-single-root-html-el/expected.js b/test/components-compilation/fixtures-vdom/boundary-single-root-html-el/expected.js index 298dc879f..46818e296 100644 --- a/test/components-compilation/fixtures-vdom/boundary-single-root-html-el/expected.js +++ b/test/components-compilation/fixtures-vdom/boundary-single-root-html-el/expected.js @@ -13,7 +13,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("d3d7a8"), - marko_node0 = marko_createElement("DIV", null, "0", null, 0, 0, { + marko_node0 = marko_createElement("div", null, "0", null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/components-compilation/fixtures-vdom/component-with-import-static/expected.js b/test/components-compilation/fixtures-vdom/component-with-import-static/expected.js index 24ba45ac2..cbf22f9af 100644 --- a/test/components-compilation/fixtures-vdom/component-with-import-static/expected.js +++ b/test/components-compilation/fixtures-vdom/component-with-import-static/expected.js @@ -18,7 +18,7 @@ var counter = 0; function render(input, out, __component, component, state) { var data = input; - out.e("DIV", null, "0", component, 1) + out.e("div", null, "0", component, 1) .t(counter++); } diff --git a/test/components-compilation/fixtures-vdom/implicit-component/expected.js b/test/components-compilation/fixtures-vdom/implicit-component/expected.js index 7ef858720..70073102a 100644 --- a/test/components-compilation/fixtures-vdom/implicit-component/expected.js +++ b/test/components-compilation/fixtures-vdom/implicit-component/expected.js @@ -12,7 +12,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(__filename), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("a0ef11"), - marko_node0 = marko_createElement("DIV", null, "0", null, 1, 0, { + marko_node0 = marko_createElement("div", null, "0", null, 1, 0, { i: marko_const_nextId() }) .t("Hello"); diff --git a/test/morphdom/index.test.js b/test/morphdom/index.test.js index dda554b58..d5edb63b7 100644 --- a/test/morphdom/index.test.js +++ b/test/morphdom/index.test.js @@ -35,7 +35,6 @@ autotest("fixtures", fixture => { let fromNode = fromDocument.body; let realToNode = toDocument.body; - var targetVEl = require("marko/runtime/vdom/vdom").___virtualize( realToNode ); diff --git a/test/taglib-lookup/fixtures/forEachTag/expected.json b/test/taglib-lookup/fixtures/forEachTag/expected.json index 3bfa8a903..cf5565bcc 100644 --- a/test/taglib-lookup/fixtures/forEachTag/expected.json +++ b/test/taglib-lookup/fixtures/forEachTag/expected.json @@ -238,5 +238,47 @@ "tspan", "use", "view", - "vkern" + "vkern", + "math", + "maction", + "maligngroup", + "malignmark", + "menclose", + "merror", + "mfenced", + "mfrac", + "mglyph", + "mi", + "mlabeledtr", + "mlongdiv", + "mmultiscripts", + "mn", + "mo", + "mover", + "mpadded", + "mphantom", + "mroot", + "mrow", + "ms", + "mscarries", + "mscarry", + "msgroup", + "mstack", + "msline", + "mspace", + "msqrt", + "msrow", + "mstyle", + "msub", + "msup", + "msubsup", + "mtable", + "mtd", + "mtext", + "mtr", + "munder", + "munderover", + "semantics", + "mprescripts", + "none" ] \ No newline at end of file diff --git a/test/taglib-lookup/fixtures/getTagsSorted/expected.json b/test/taglib-lookup/fixtures/getTagsSorted/expected.json index 4d9fcabbe..cc4def453 100644 --- a/test/taglib-lookup/fixtures/getTagsSorted/expected.json +++ b/test/taglib-lookup/fixtures/getTagsSorted/expected.json @@ -152,7 +152,10 @@ "link", "macro", "macro-body", + "maction", "main", + "maligngroup", + "malignmark", "map", "mark", "marker", @@ -160,16 +163,54 @@ "marko-preserve-whitespace", "marquee", "mask", + "math", + "menclose", "menu", "menuitem", + "merror", "meta", "metadata", "meter", + "mfenced", + "mfrac", + "mglyph", + "mi", "missing-glyph", + "mlabeledtr", + "mlongdiv", + "mmultiscripts", + "mn", + "mo", "module-code", + "mover", + "mpadded", "mpath", + "mphantom", + "mprescripts", + "mroot", + "mrow", + "ms", + "mscarries", + "mscarry", + "msgroup", + "msline", + "mspace", + "msqrt", + "msrow", + "mstack", + "mstyle", + "msub", + "msubsup", + "msup", + "mtable", + "mtd", + "mtext", + "mtr", + "munder", + "munderover", "nav", "no-update", + "none", "noscript", "object", "ol", @@ -197,6 +238,7 @@ "script", "section", "select", + "semantics", "set", "small", "source", diff --git a/test/vdom-compiler/fixtures/attr-class-expression/expected.js b/test/vdom-compiler/fixtures/attr-class-expression/expected.js index 68d6c491c..a0cc45faa 100644 --- a/test/vdom-compiler/fixtures/attr-class-expression/expected.js +++ b/test/vdom-compiler/fixtures/attr-class-expression/expected.js @@ -15,7 +15,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), function render(input, out, __component, component, state) { var data = input; - out.e("DIV", { + out.e("div", { "class": marko_classAttr(marko_classList([ "foo", { @@ -23,7 +23,7 @@ function render(input, out, __component, component, state) { baz: false } ])) - }, null, null, 3, 4) + }, null, null, 3, 1) .t("Hello ") .t(name) .t("!"); diff --git a/test/vdom-compiler/fixtures/attrs-dynamic-object-literal/expected.js b/test/vdom-compiler/fixtures/attrs-dynamic-object-literal/expected.js index e3a1f2cee..9cf238d0d 100644 --- a/test/vdom-compiler/fixtures/attrs-dynamic-object-literal/expected.js +++ b/test/vdom-compiler/fixtures/attrs-dynamic-object-literal/expected.js @@ -14,7 +14,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), function render(input, out, __component, component, state) { var data = input; - out.e("DIV", marko_attrs({ + out.e("div", marko_attrs({ foo: "bar", hello: "world" }), null, null, 3) diff --git a/test/vdom-compiler/fixtures/attrs-dynamic/expected.js b/test/vdom-compiler/fixtures/attrs-dynamic/expected.js index ad7884c08..0c05c59f4 100644 --- a/test/vdom-compiler/fixtures/attrs-dynamic/expected.js +++ b/test/vdom-compiler/fixtures/attrs-dynamic/expected.js @@ -19,7 +19,7 @@ function render(input, out, __component, component, state) { hello: "world" } - out.e("DIV", marko_attrs(attrs), null, null, 3) + out.e("div", marko_attrs(attrs), null, null, 3) .t("Hello ") .t(name) .t("!"); diff --git a/test/vdom-compiler/fixtures/custom-tag/expected.js b/test/vdom-compiler/fixtures/custom-tag/expected.js index 7d2f2cdc4..dc7b8a3d0 100644 --- a/test/vdom-compiler/fixtures/custom-tag/expected.js +++ b/test/vdom-compiler/fixtures/custom-tag/expected.js @@ -14,7 +14,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("cee604"), - marko_node0 = marko_createElement("A", { + marko_node0 = marko_createElement("a", { href: "foo" }, null, null, 1, 0, { i: marko_const_nextId() @@ -24,7 +24,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), function render(input, out, __component, component, state) { var data = input; - out.be("DIV"); + out.be("div"); test_hello_tag({ name: "World", diff --git a/test/vdom-compiler/fixtures/doctype/expected.js b/test/vdom-compiler/fixtures/doctype/expected.js index 4dace502b..683a1b6ca 100644 --- a/test/vdom-compiler/fixtures/doctype/expected.js +++ b/test/vdom-compiler/fixtures/doctype/expected.js @@ -12,7 +12,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("a51026"), - marko_node0 = marko_createElement("DIV", null, null, null, 0, 0, { + marko_node0 = marko_createElement("div", null, null, null, 0, 0, { i: marko_const_nextId() }); diff --git a/test/vdom-compiler/fixtures/dynamic-body-text/expected.js b/test/vdom-compiler/fixtures/dynamic-body-text/expected.js index cca8a321b..a22c1dbf3 100644 --- a/test/vdom-compiler/fixtures/dynamic-body-text/expected.js +++ b/test/vdom-compiler/fixtures/dynamic-body-text/expected.js @@ -15,7 +15,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), function render(input, out, __component, component, state) { var data = input; - out.e("DIV", marko_attrs0, null, null, 3) + out.e("div", marko_attrs0, null, null, 3) .t("Hello ") .t(name) .t("!"); diff --git a/test/vdom-compiler/fixtures/simple/expected.js b/test/vdom-compiler/fixtures/simple/expected.js index 45f1d7458..41c1fda70 100644 --- a/test/vdom-compiler/fixtures/simple/expected.js +++ b/test/vdom-compiler/fixtures/simple/expected.js @@ -13,7 +13,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("9e11e1"), - marko_node0 = marko_createElement("DIV", null, null, null, 1, 0, { + marko_node0 = marko_createElement("div", null, null, null, 1, 0, { i: marko_const_nextId() }) .t("No colors!"); @@ -21,16 +21,16 @@ var marko_template = module.exports = require("marko/src/vdom").t(), function render(input, out, __component, component, state) { var data = input; - out.e("H1", null, null, null, 3) + out.e("h1", null, null, null, 3) .t("Hello ") .t(input.name) .t("!"); if (input.colors.length) { - out.be("UL"); + out.be("ul"); marko_forEach(input.colors, function(color) { - out.e("LI", null, null, null, 1) + out.e("li", null, null, null, 1) .t(color); }); diff --git a/test/vdom-compiler/fixtures/static-element-nested/expected.js b/test/vdom-compiler/fixtures/static-element-nested/expected.js index fe0847334..fcfecf55c 100644 --- a/test/vdom-compiler/fixtures/static-element-nested/expected.js +++ b/test/vdom-compiler/fixtures/static-element-nested/expected.js @@ -12,7 +12,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("6d8f0e"), - marko_node0 = marko_createElement("DIV", { + marko_node0 = marko_createElement("div", { "class": "hello", onclick: "onClick()" }, null, null, 1, 0, { @@ -23,8 +23,8 @@ var marko_template = module.exports = require("marko/src/vdom").t(), function render(input, out, __component, component, state) { var data = input; - out.e("SPAN", null, null, null, 2) - .e("H1", null, null, null, 3) + out.e("span", null, null, null, 2) + .e("h1", null, null, null, 3) .t("Hello ") .t(input.name) .t("!") diff --git a/test/vdom-compiler/fixtures/static-element-root/expected.js b/test/vdom-compiler/fixtures/static-element-root/expected.js index 6abc99a8a..7c5504cc3 100644 --- a/test/vdom-compiler/fixtures/static-element-root/expected.js +++ b/test/vdom-compiler/fixtures/static-element-root/expected.js @@ -12,7 +12,7 @@ var marko_template = module.exports = require("marko/src/vdom").t(), marko_createElement = marko_helpers.e, marko_const = marko_helpers.const, marko_const_nextId = marko_const("0524f9"), - marko_node0 = marko_createElement("DIV", { + marko_node0 = marko_createElement("div", { "class": "hello", onclick: "onClick()" }, null, null, 1, 0, { diff --git a/test/vdom-create/fixtures/cloneNode-documentFragment/expected.html b/test/vdom-create/fixtures/cloneNode-documentFragment/expected.html index 8214f2276..802032b68 100644 --- a/test/vdom-create/fixtures/cloneNode-documentFragment/expected.html +++ b/test/vdom-create/fixtures/cloneNode-documentFragment/expected.html @@ -1 +1 @@ - + diff --git a/test/vdom-create/fixtures/cloneNode-documentFragment/index.js b/test/vdom-create/fixtures/cloneNode-documentFragment/index.js index df0763247..1be785d03 100644 --- a/test/vdom-create/fixtures/cloneNode-documentFragment/index.js +++ b/test/vdom-create/fixtures/cloneNode-documentFragment/index.js @@ -1,22 +1,17 @@ var expect = require("chai").expect; module.exports = function(helpers) { - var SVG_FLAGS = 1; // SVG - var svg = helpers.vdom.createElement( "svg", null /* attrs */, null /* key */, null /* component */, - null /* child count */, - SVG_FLAGS + null /* child count */ ); var docFragment = helpers.vdom.createDocumentFragment(); svg.___appendChild(docFragment); - expect(svg.___namespaceURI).to.equal("http://www.w3.org/2000/svg"); - var docFragmentClone = docFragment.___cloneNode(); expect(docFragmentClone.___nextSibling).to.equal(null); expect(docFragmentClone.___parentNode == null).to.equal(true); diff --git a/test/vdom-create/fixtures/cloneNode/expected.html b/test/vdom-create/fixtures/cloneNode/expected.html index 41f90905a..09bc96c92 100644 --- a/test/vdom-create/fixtures/cloneNode/expected.html +++ b/test/vdom-create/fixtures/cloneNode/expected.html @@ -1,4 +1,4 @@
- - + + diff --git a/test/vdom-create/fixtures/cloneNode/index.js b/test/vdom-create/fixtures/cloneNode/index.js index 2763f743f..1570b7079 100644 --- a/test/vdom-create/fixtures/cloneNode/index.js +++ b/test/vdom-create/fixtures/cloneNode/index.js @@ -1,8 +1,6 @@ var expect = require("chai").expect; module.exports = function(helpers) { - var SVG_FLAGS = 1; // SVG - var el = helpers.vdom .createElement( "div", @@ -22,9 +20,7 @@ module.exports = function(helpers) { }, null, null, - 1, - SVG_FLAGS, - null + 1 ) .e( "circle", @@ -39,9 +35,7 @@ module.exports = function(helpers) { }, null, null, - 0, - SVG_FLAGS, - null + 0 ); var clone = el.___cloneNode(); diff --git a/test/vdom-create/fixtures/static-tree-svg/index.js b/test/vdom-create/fixtures/static-tree-svg/index.js index 6dcc91014..d46bd072b 100644 --- a/test/vdom-create/fixtures/static-tree-svg/index.js +++ b/test/vdom-create/fixtures/static-tree-svg/index.js @@ -1,18 +1,23 @@ module.exports = function(helpers) { - var FLAGS = 1; // SVG + var svg = helpers.vdom.createElement( + "svg", + { height: "150", width: "400" }, + null + ); + var linearGradient = helpers.vdom.createElement( "linearGradient", { x1: "0%", y1: "0%", x2: "100%", y2: "0%" }, - null, - FLAGS + null ); + svg.___appendChild(linearGradient); + linearGradient.___appendChild( helpers.vdom.createElement( "stop", { offset: "0%", style: "stop-color:rgb(255,255,0);stop-opacity:1" }, - null, - FLAGS + null ) ); @@ -20,19 +25,9 @@ module.exports = function(helpers) { helpers.vdom.createElement( "stop", { offset: "100%", style: "stop-color:rgb(255,0,0);stop-opacity:1" }, - null, - FLAGS + null ) ); - var svg = helpers.vdom.createElement( - "svg", - { height: "150", width: "400" }, - null, - FLAGS - ); - - svg.___appendChild(linearGradient); - return svg; }; diff --git a/test/vdom-create/fixtures/svg-dynamic/index.js b/test/vdom-create/fixtures/svg-dynamic/index.js index 055ebdab1..2263f91c8 100644 --- a/test/vdom-create/fixtures/svg-dynamic/index.js +++ b/test/vdom-create/fixtures/svg-dynamic/index.js @@ -7,7 +7,7 @@ module.exports = function(helpers) { { class: "foo", onclick: "doSomething()" }, 1 /* childCount */ ) - .ed( + .e( "svg", { width: "100", @@ -15,7 +15,7 @@ module.exports = function(helpers) { xmlns: "http://www.w3.org/2000/svg" }, 1 - ) //NO SVG FLAG, from xmlns + ) .e( "circle", { diff --git a/test/vdom-create/fixtures/svg/index.js b/test/vdom-create/fixtures/svg/index.js index 2f2234bd1..4c7bc9dca 100644 --- a/test/vdom-create/fixtures/svg/index.js +++ b/test/vdom-create/fixtures/svg/index.js @@ -1,13 +1,11 @@ module.exports = function(helpers) { - var FLAGS = 1; - return helpers.vdom .createElement( "div", { class: "foo", onclick: "doSomething()" }, 1 /* childCount */ ) - .e("svg", { width: "100", height: "100" }, 1, FLAGS) + .e("svg", { width: "100", height: "100" }, 1) .e( "circle", { @@ -19,7 +17,6 @@ module.exports = function(helpers) { fill: "yellow", "xlink:href": "http://ebay.com/" }, - 0, - FLAGS + 0 ); }; diff --git a/test/vdom-create/fixtures/textarea-invalid-child/index.js b/test/vdom-create/fixtures/textarea-invalid-child/index.js index 534e7807d..aa36c24e1 100644 --- a/test/vdom-create/fixtures/textarea-invalid-child/index.js +++ b/test/vdom-create/fixtures/textarea-invalid-child/index.js @@ -1,7 +1,6 @@ var expect = require("chai").expect; module.exports = function(helpers) { - var TEXTAREA_FLAGS = 2; expect(function() { helpers.vdom .createElement( @@ -9,8 +8,7 @@ module.exports = function(helpers) { {}, null /* key */, null /* component */, - 2 /* childCount */, - TEXTAREA_FLAGS + 2 /* childCount */ ) .e("div", {}, null /* key */, null /* component */, 0) .t("bar"); diff --git a/test/vdom-virtualize/fixtures/attr-value-empty-string/virtualized-expected.html b/test/vdom-virtualize/fixtures/attr-value-empty-string/virtualized-expected.html index e6e9bdb20..9e3483782 100644 --- a/test/vdom-virtualize/fixtures/attr-value-empty-string/virtualized-expected.html +++ b/test/vdom-virtualize/fixtures/attr-value-empty-string/virtualized-expected.html @@ -1 +1 @@ -
+
"\n " -

+

"Hello World" "\n " diff --git a/test/vdom-virtualize/fixtures/math/virtualized-expected.html b/test/vdom-virtualize/fixtures/math/virtualized-expected.html index f2188ea6b..77a0cd709 100644 --- a/test/vdom-virtualize/fixtures/math/virtualized-expected.html +++ b/test/vdom-virtualize/fixtures/math/virtualized-expected.html @@ -1,40 +1,40 @@ - + "\n" - + "\n " - + "\n " - + " 0 " " " - + " 1 " " " - + " 0 " "\n " "\n " - + "\n " - + " 0 " " " - + " 0 " " " - + " 1 " "\n " "\n " - + "\n " - + " 1 " " " - + " 0 " " " - + " 0 " "\n " "\n" diff --git a/test/vdom-virtualize/fixtures/one-empty-element/virtualized-expected.html b/test/vdom-virtualize/fixtures/one-empty-element/virtualized-expected.html index 8ce91aa02..e54a27324 100644 --- a/test/vdom-virtualize/fixtures/one-empty-element/virtualized-expected.html +++ b/test/vdom-virtualize/fixtures/one-empty-element/virtualized-expected.html @@ -1 +1 @@ -
+
diff --git a/test/vdom-virtualize/fixtures/svg-xlink/virtualized-expected.html b/test/vdom-virtualize/fixtures/svg-xlink/virtualized-expected.html index 96e03518f..5ef369d42 100644 --- a/test/vdom-virtualize/fixtures/svg-xlink/virtualized-expected.html +++ b/test/vdom-virtualize/fixtures/svg-xlink/virtualized-expected.html @@ -1,7 +1,7 @@ -
+
"\n " - + "\n " - + "\n " "\n" diff --git a/test/vdom-virtualize/fixtures/svg/virtualized-expected.html b/test/vdom-virtualize/fixtures/svg/virtualized-expected.html index 634cb34e7..8eed4cbf0 100644 --- a/test/vdom-virtualize/fixtures/svg/virtualized-expected.html +++ b/test/vdom-virtualize/fixtures/svg/virtualized-expected.html @@ -1,7 +1,7 @@ -
+
"\n " - + "\n " - + "\n " "\n" diff --git a/test/vdom-virtualize/fixtures/textarea/virtualized-expected.html b/test/vdom-virtualize/fixtures/textarea/virtualized-expected.html index fa1c1d179..6fecc7649 100644 --- a/test/vdom-virtualize/fixtures/textarea/virtualized-expected.html +++ b/test/vdom-virtualize/fixtures/textarea/virtualized-expected.html @@ -1,2 +1,2 @@ -