www

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

commit a714a91dc60ca7155f50b106d98cb9d1a9e500d9
parent 142857afa2ca5854f72c3955f1676660c79b2e72
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Sat,  6 Dec 2014 17:36:23 -0500

Add a flag to Get() to look up only the inherited value, not the one from the element itself, so that toMathML() doesn't have to delete and replace the attibutes.  Resolves issue #971.

Diffstat:
Munpacked/extensions/toMathML.js | 5++---
Munpacked/jax/element/mml/jax.js | 8+++++---
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/unpacked/extensions/toMathML.js b/unpacked/extensions/toMathML.js @@ -61,9 +61,8 @@ MathJax.Hub.Register.LoadHook("[MathJax]/jax/element/mml/jax.js",function () { if (this.type === "mstyle") {defaults = MML.math.prototype.defaults} for (var id in defaults) {if (!skip[id] && !copy[id] && defaults.hasOwnProperty(id)) { if (this[id] != null && this[id] !== defaults[id]) { - var value = this[id]; delete this[id]; - if (this.Get(id) !== value) {attr.push(id+'="'+this.toMathMLattribute(value)+'"')} - this[id] = value; + if (this.Get(id,null,1) !== this[id]) + attr.push(id+'="'+this.toMathMLattribute(this[id])+'"'); } }} } diff --git a/unpacked/jax/element/mml/jax.js b/unpacked/jax/element/mml/jax.js @@ -296,9 +296,11 @@ MathJax.ElementJax.mml.Augment({ while (parent && parent.notParent) {parent = parent.parent} return parent; }, - Get: function (name,nodefault) { - if (this[name] != null) {return this[name]} - if (this.attr && this.attr[name] != null) {return this.attr[name]} + Get: function (name,nodefault,noself) { + if (!noself) { + if (this[name] != null) {return this[name]} + if (this.attr && this.attr[name] != null) {return this.attr[name]} + } // FIXME: should cache these values and get from cache // (clear cache when appended to a new object?) var parent = this.Parent();