Handle mstyle defaults properly for attribute input/output.

This commit is contained in:
Davide P. Cervone 2014-12-28 18:03:16 -05:00
parent 2ea8bf10d5
commit 519ff32aae
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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]))}
}}