www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 519ff32aaeab13f187dafb602d4e506111b68e7f
parent 2ea8bf10d5546b5f7a9929b27163ab917a3a4ea5
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Sun, 28 Dec 2014 18:03:16 -0500

Handle mstyle defaults properly for attribute input/output.

Diffstat:
Munpacked/jax/input/MathML/jax.js | 3++-
Munpacked/jax/output/NativeMML/jax.js | 3+--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/unpacked/jax/input/MathML/jax.js b/unpacked/jax/input/MathML/jax.js @@ -140,10 +140,11 @@ if (name.match(/^_moz-math-((column|row)(align|line)|font-style)$/)) continue; var value = node.attributes[i].value; value = this.filterAttribute(name,value); + var defaults = (mml.type === "mstyle" ? MML.math.prototype.defaults : mml.defaults); if (value != null) { if (value.toLowerCase() === "true") {value = true} else if (value.toLowerCase() === "false") {value = false} - if (mml.defaults[name] != null || MML.copyAttributes[name]) + if (defaults[name] != null || MML.copyAttributes[name]) {mml[name] = value} else {mml.attr[name] = value} mml.attrNames.push(name); } diff --git a/unpacked/jax/output/NativeMML/jax.js b/unpacked/jax/output/NativeMML/jax.js @@ -490,10 +490,9 @@ // and set those in the tag's attribute list // NativeMMLattributes: function (tag) { - var defaults = this.defaults; + var defaults = (this.type === "mstyle" ? MML.math.prototype.defaults : this.defaults); var copy = (this.attrNames||MML.copyAttributeNames), skip = MML.skipAttributes; if (!this.attrNames) { - if (this.type === "mstyle") {defaults = MML.math.prototype.defaults} for (var id in defaults) {if (!skip[id] && defaults.hasOwnProperty(id)) { if (this[id] != null && this[id] !== defaults[id]) {tag.setAttribute(id,this.NativeMMLattribute(this[id]))} }}